From 7715629a374f3f5091d8488ceeac54af77855b82 Mon Sep 17 00:00:00 2001 From: Klaus Purer Date: Fri, 28 Jun 2024 13:18:35 +0300 Subject: [PATCH 1/4] test(drupal): Test Drupal 10.3 --- .github/workflows/testing.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 063e6515f..0a94c1823 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,13 +14,17 @@ jobs: fail-fast: false matrix: php-versions: ['8.1', '8.2'] - drupal-core: ['10.2.x'] + drupal-core: ['10.3.x'] phpstan: ['0'] include: # Extra run to test older supported Drupal 10.1.x. - php-versions: '8.1' drupal-core: '10.1.x' phpstan: '0' + # Extra run to test older supported Drupal 10.2.x. + - php-versions: '8.1' + drupal-core: '10.2.x' + phpstan: '0' # We only need to run PHPStan once on the latest PHP version. - php-versions: '8.3' drupal-core: '10.2.x' From ee51ddf21dd6ce12b1302969627a2b80846d88aa Mon Sep 17 00:00:00 2001 From: Klaus Purer Date: Fri, 28 Jun 2024 13:19:09 +0300 Subject: [PATCH 2/4] phpstan on 10.3 --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0a94c1823..419545349 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -27,7 +27,7 @@ jobs: phpstan: '0' # We only need to run PHPStan once on the latest PHP version. - php-versions: '8.3' - drupal-core: '10.2.x' + drupal-core: '10.3.x' phpstan: '1' steps: - name: Checkout Drupal core From 286ee285e7ede4d05432bbe81c84ccd7a58cfbf0 Mon Sep 17 00:00:00 2001 From: Klaus Purer Date: Fri, 28 Jun 2024 13:32:27 +0300 Subject: [PATCH 3/4] Fix test fails --- tests/src/Kernel/DataProducer/RoutingTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/src/Kernel/DataProducer/RoutingTest.php b/tests/src/Kernel/DataProducer/RoutingTest.php index 5c1f7461b..7c4e6ea66 100644 --- a/tests/src/Kernel/DataProducer/RoutingTest.php +++ b/tests/src/Kernel/DataProducer/RoutingTest.php @@ -35,6 +35,7 @@ class RoutingTest extends GraphQLTestBase { public function setUp(): void { parent::setUp(); + $this->installEntitySchema('path_alias'); $this->installEntitySchema('redirect'); $this->installConfig(['redirect']); @@ -129,7 +130,8 @@ public function testUrlPath(): void { 'url' => $url, ]); - $this->assertEquals('/user/logout', $result); + // Starting with Drupal 10.3 the URL has a token at the end, ignore that. + $this->assertStringStartsWith('/user/logout', $result); } /** From dac22bffff311d2ff8bf0df88c4b13292bc721ed Mon Sep 17 00:00:00 2001 From: Klaus Purer Date: Fri, 28 Jun 2024 13:43:59 +0300 Subject: [PATCH 4/4] fix deprecated constant --- src/Config/LanguageConfigOverride.php | 1 - src/GraphQL/Utility/FileUpload.php | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Config/LanguageConfigOverride.php b/src/Config/LanguageConfigOverride.php index 979b3bffb..f6c7c4171 100644 --- a/src/Config/LanguageConfigOverride.php +++ b/src/Config/LanguageConfigOverride.php @@ -75,7 +75,6 @@ public function getCacheSuffix() { public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) { // The interface says we should return an object here, but we don't care and // this does not seem to break anything? - // @phpstan-ignore-next-line return NULL; } diff --git a/src/GraphQL/Utility/FileUpload.php b/src/GraphQL/Utility/FileUpload.php index 7f8cbd124..7543ea5c7 100644 --- a/src/GraphQL/Utility/FileUpload.php +++ b/src/GraphQL/Utility/FileUpload.php @@ -248,6 +248,8 @@ public function saveFileUpload(UploadedFile $uploaded_file, array $settings): Fi $temp_file_path = $uploaded_file->getRealPath(); + // Drupal 10.2 compatibility: use the deprecated constant for now. + // @phpstan-ignore-next-line $file_uri = $this->fileSystem->getDestinationFilename($file_uri, FileSystemInterface::EXISTS_RENAME); // Lock based on the prepared file URI. @@ -291,6 +293,8 @@ public function saveFileUpload(UploadedFile $uploaded_file, array $settings): Fi // FileSystemInterface::EXISTS_ERROR as the file location has already been // determined above in FileSystem::getDestinationFilename(). try { + // Drupal 10.2 compatibility: use the deprecated constant for now. + // @phpstan-ignore-next-line $this->fileSystem->move($temp_file_path, $file_uri, FileSystemInterface::EXISTS_ERROR); } catch (FileException $e) {