diff --git a/tests/src/Kernel/Framework/TestFrameworkTest.php b/tests/src/Kernel/Framework/TestFrameworkTest.php index 1151088bd..6459d584b 100644 --- a/tests/src/Kernel/Framework/TestFrameworkTest.php +++ b/tests/src/Kernel/Framework/TestFrameworkTest.php @@ -5,7 +5,6 @@ use Drupal\Core\Cache\CacheableMetadata; use Drupal\graphql\GraphQL\Cache\CacheableValue; use Drupal\graphql\GraphQL\Execution\ResolveContext; -use Drupal\graphql\Plugin\SchemaBuilder; use Drupal\Tests\graphql\Kernel\GraphQLTestBase; use GraphQL\Type\Definition\ResolveInfo; @@ -35,7 +34,7 @@ public function testFieldMock() { ]); $schema = $this->introspect(); - $this->assertArraySubset([ + $this->assertSame([ 'types' => [ 'Query' => [ 'fields' => [ @@ -232,13 +231,17 @@ public function testUnionMock() { 'name' => 'value', 'type' => 'Int', 'parents' => ['Number'], - ], function ($value) { yield $value['value']; }); + ], function ($value) { + yield $value['value']; + }); $this->mockField('string_value', [ 'name' => 'value', 'type' => 'String', 'parents' => ['Word'], - ], function ($value) { yield $value['value']; }); + ], function ($value) { + yield $value['value']; + }); $this->mockField('root', [ 'name' => 'root', diff --git a/tests/src/Traits/GraphQLFileTestTrait.php b/tests/src/Traits/GraphQLFileTestTrait.php index a68ce7236..bce78549e 100644 --- a/tests/src/Traits/GraphQLFileTestTrait.php +++ b/tests/src/Traits/GraphQLFileTestTrait.php @@ -18,7 +18,7 @@ trait GraphQLFileTestTrait { * The path to the collection of test query files. */ protected function getQueriesDirectory() { - return drupal_get_path('module', explode('\\', get_class($this))[2]) . '/tests/queries'; + return \Drupal::service('extension.list.module')->getPath('module', explode('\\', get_class($this))[2]) . '/tests/queries' } /** diff --git a/tests/src/Unit/StringFormattingTest.php b/tests/src/Unit/StringFormattingTest.php index cc6b8fa67..d719d2e79 100644 --- a/tests/src/Unit/StringFormattingTest.php +++ b/tests/src/Unit/StringFormattingTest.php @@ -17,7 +17,7 @@ class StringFormattingTest extends UnitTestCase { * @expectedExceptionMessageRegExp /Failed to create a specification compliant string representation for '.+'\./ */ public function testFailureOnInvalidInput() { - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); StringHelper::camelCase('^%!@#&'); }