From e74a854314d4bbf20157e24cfbdd2a2e03fbf892 Mon Sep 17 00:00:00 2001 From: Ankit Pathak Date: Fri, 2 Aug 2024 17:45:00 +0530 Subject: [PATCH] Moving module changes into eventSubscriber. --- .github/workflows/testing.yml | 2 +- .../graphql_file_validate.module | 17 ----------------- .../GraphqlFileValidationTestSubscriber.php | 4 +++- 3 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 tests/modules/graphql_file_validate/graphql_file_validate.module diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8ef1367c1..89da49b3d 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -7,7 +7,7 @@ on: jobs: drupal: name: Drupal ${{ matrix.drupal-core }} (PHP ${{ matrix.php-versions }}) - # We cannot use ubuntu-latest right now as it still points to 22.04 and we need a newer database driver." + # We cannot use ubuntu-latest right now as it still points to 22.04 and we need a newer database driver. runs-on: ubuntu-24.04 env: extensions: mbstring, xml, pdo_sqlite, gd, opcache diff --git a/tests/modules/graphql_file_validate/graphql_file_validate.module b/tests/modules/graphql_file_validate/graphql_file_validate.module deleted file mode 100644 index 027f3a360..000000000 --- a/tests/modules/graphql_file_validate/graphql_file_validate.module +++ /dev/null @@ -1,17 +0,0 @@ -getFileUri())) { - throw new \Exception('File does not exist during validation: ' . $file->getFileUri()); - } -} diff --git a/tests/modules/graphql_file_validate/src/EventSubscriber/GraphqlFileValidationTestSubscriber.php b/tests/modules/graphql_file_validate/src/EventSubscriber/GraphqlFileValidationTestSubscriber.php index 819373671..84fa44fc8 100644 --- a/tests/modules/graphql_file_validate/src/EventSubscriber/GraphqlFileValidationTestSubscriber.php +++ b/tests/modules/graphql_file_validate/src/EventSubscriber/GraphqlFileValidationTestSubscriber.php @@ -19,7 +19,9 @@ class GraphqlFileValidationTestSubscriber implements EventSubscriberInterface { * The event. */ public function onFileValidation(FileValidationEvent $event): void { - graphql_file_validate_test_file($event->file); + if (!file_exists($event->file->getFileUri())) { + throw new \Exception('File does not exist during validation: ' . $file->getFileUri()); + } } /**