Skip to content

Commit

Permalink
test(drupal): Test Drupal 10.3 (#1410)
Browse files Browse the repository at this point in the history
  • Loading branch information
klausi committed Jun 28, 2024
1 parent 79d09dd commit 75dd0a4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@ 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'
drupal-core: '10.3.x'
phpstan: '1'
steps:
- name: Checkout Drupal core
Expand Down
1 change: 0 additions & 1 deletion src/Config/LanguageConfigOverride.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 4 additions & 0 deletions src/GraphQL/Utility/FileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion tests/src/Kernel/DataProducer/RoutingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class RoutingTest extends GraphQLTestBase {
public function setUp(): void {
parent::setUp();

$this->installEntitySchema('path_alias');
$this->installEntitySchema('redirect');
$this->installConfig(['redirect']);

Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 75dd0a4

Please sign in to comment.