Skip to content

Commit 11e9b07

Browse files
authored
Fix 8.6 tests (#675)
* Remove suites and listeners. * Run drupal-phpunit-upgrade if applicable. * Typo. * Inverting condition. * Fix. * Fix. * Fix. * Run user module install hook to make sure anonymous user is there. * Test fixes.
1 parent 6f8abb4 commit 11e9b07

5 files changed

Lines changed: 11 additions & 14 deletions

File tree

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ install:
9393
# require also triggers a full 'composer install'.
9494
- composer --working-dir=$DRUPAL_BUILD_DIR require webonyx/graphql-php:^0.12.5
9595

96+
- if [[ "$DRUPAL_CORE" != "8.3.x" && "$DRUPAL_CORE" != "8.4.x" ]];
97+
then composer --working-dir=$DRUPAL_BUILD_DIR run-script drupal-phpunit-upgrade;
98+
fi
99+
96100
script:
97101
# Run the unit tests using phpdbg if the environment variable is 'true'.
98102
- if [[ "$WITH_PHPDBG_COVERAGE" == "true" ]];

modules/graphql_core/tests/src/Kernel/Entity/EntityBasicFieldsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function testBasicFields() {
8383
$metadata->addCacheTags([
8484
'node:1',
8585
'node_list',
86-
'user:1',
86+
'user:2',
8787
]);
8888

8989
$this->assertResults($query, ['nid' => (string) $node->id()], [

modules/graphql_core/tests/src/Kernel/Entity/EntityFieldValueTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ public function testRawValues($actualFieldValues, $expectedFieldValues) {
269269
'config:field.storage.node.field_reference',
270270
'entity_field_info',
271271
'node:1',
272+
'user:0',
272273
'file:1',
273274
'file:2',
274275
]);
@@ -355,7 +356,9 @@ public function nodeValuesProvider() {
355356
],
356357
'uid' => [
357358
'targetId' => 0,
358-
'entity' => NULL,
359+
'entity' => [
360+
'name' => '',
361+
],
359362
],
360363
'title' => 'Test',
361364
'status' => TRUE,

modules/graphql_core/tests/src/Kernel/GraphQLCoreTestBase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ protected function setUp() {
3535
parent::setUp();
3636
// User entity schema is required for the currentUserContext field.
3737
$this->installEntitySchema('user');
38+
module_load_include('install', 'user', 'user');
39+
user_install();
3840
}
3941

4042
}

phpunit.xml.dist

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,6 @@
55
beStrictAboutOutputDuringTests="true"
66
beStrictAboutChangesToGlobalState="true"
77
checkForUnintentionallyCoveredCode="false">
8-
<testsuites>
9-
<testsuite name="unit">
10-
<file>./tests/TestSuites/UnitTestSuite.php</file>
11-
</testsuite>
12-
<testsuite name="kernel">
13-
<file>./tests/TestSuites/KernelTestSuite.php</file>
14-
</testsuite>
15-
</testsuites>
16-
<listeners>
17-
<listener class="\Drupal\Tests\Listeners\DrupalStandardsListener">
18-
</listener>
19-
</listeners>
208
<filter>
219
<whitelist>
2210
<directory suffix=".php">../modules/graphql</directory>

0 commit comments

Comments
 (0)