Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(drupal): Test Drupal 10.3 #1410

Merged
merged 4 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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