Skip to content

Commit 30538b0

Browse files
authored
test(core): Update Drupal core to 9.3 for testing (#1255)
1 parent eb7430e commit 30538b0

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
php-versions: ['7.3', '7.4', '8.0']
17-
drupal-core: ['9.2.x']
17+
drupal-core: ['9.3.x']
1818
include:
1919
# Extra run to also test on latest Drupal 8 and PHP 7.2.
2020
- php-versions: '7.2'

phpstan.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ parameters:
4646
- """
4747
#^Call to deprecated function file_munge_filename\\(\\)#
4848
"""
49+
- """
50+
#^Call to deprecated function drupal_get_path\\(\\)#
51+
"""
52+
- """
53+
#^Call to deprecated function file_create_url\\(\\)#
54+
"""
55+
- "#^Call to an undefined method Drupal\\\\Tests\\\\graphql\\\\Kernel\\\\DataProducer\\\\EntityTest\\:\\:assertMatchesRegularExpression\\(\\)\\.$#"
4956
# Drupal allows object property access to custom fields, so we cannot fix
5057
# that.
5158
- "#^Property Drupal\\\\.+ \\(Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\) does not accept .+\\.$#"

tests/src/Kernel/DataProducer/EntityTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,14 @@ public function testResolveEntityRendered(): void {
377377

378378
// @todo Add metadata check.
379379
// $this->assertContains('node:1', $metadata->getCacheTags());
380-
$this->assertStringContainsString('<a href="/node/1" rel="bookmark"><span>' . $this->node->getTitle() . '</span>', $result);
380+
// Rendered output is slightly different in Drupal 8 vs. 9.
381+
[$version] = explode('.', \Drupal::VERSION, 2);
382+
if ($version == 8) {
383+
$this->assertStringContainsString('<a href="/node/1" rel="bookmark"><span>' . $this->node->getTitle() . '</span>', $result);
384+
}
385+
else {
386+
$this->assertMatchesRegularExpression('#<a href="/node/1" rel="bookmark">\s*<span>' . $this->node->getTitle() . '</span>#', $result);
387+
}
381388
}
382389

383390
}

0 commit comments

Comments
 (0)