From 715146cdd18b8c6a2ed4c8349b13980970eba043 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Fri, 31 Aug 2018 11:07:29 +0200 Subject: [PATCH] Add void return typehint to test methods --- tests/Executor/AbstractPromiseTest.php | 14 +- tests/Executor/AbstractTest.php | 12 +- tests/Executor/DeferredFieldsTest.php | 6 +- tests/Executor/DirectivesTest.php | 31 +--- tests/Executor/ExecutionResultTest.php | 4 +- tests/Executor/ExecutorLazySchemaTest.php | 10 +- tests/Executor/ExecutorSchemaTest.php | 2 +- tests/Executor/ExecutorTest.php | 48 +++--- tests/Executor/LazyInterfaceTest.php | 2 +- tests/Executor/ListsTest.php | 48 +++--- tests/Executor/MutationsTest.php | 4 +- tests/Executor/NonNullTest.php | 40 ++--- .../Promise/ReactPromiseAdapterTest.php | 16 +- .../Promise/SyncPromiseAdapterTest.php | 16 +- tests/Executor/Promise/SyncPromiseTest.php | 4 +- tests/Executor/ResolveTest.php | 8 +- tests/Executor/SyncTest.php | 14 +- tests/Executor/UnionInterfaceTest.php | 14 +- tests/Executor/ValuesTest.php | 26 +-- tests/Executor/VariablesTest.php | 80 +++++---- tests/Language/LexerTest.php | 34 ++-- tests/Language/ParserTest.php | 60 +++---- tests/Language/PrinterTest.php | 20 +-- tests/Language/SchemaParserTest.php | 70 ++++---- tests/Language/SchemaPrinterTest.php | 8 +- tests/Language/SerializationTest.php | 8 +- tests/Language/TokenTest.php | 2 +- tests/Language/VisitorTest.php | 44 ++--- tests/Server/PsrResponseTest.php | 2 +- tests/Server/QueryExecutionTest.php | 48 +++--- tests/Server/RequestParsingTest.php | 43 ++--- tests/Server/RequestValidationTest.php | 18 +-- tests/Server/ServerConfigTest.php | 28 ++-- tests/Server/StandardServerTest.php | 6 +- tests/StarWarsIntrospectionTest.php | 18 +-- tests/StarWarsQueryTest.php | 18 +-- tests/StarWarsValidationTest.php | 14 +- tests/Type/DefinitionTest.php | 148 ++++++++--------- tests/Type/EnumTypeTest.php | 44 ++--- tests/Type/IntrospectionTest.php | 17 +- tests/Type/ResolutionTest.php | 10 +- tests/Type/ResolveInfoTest.php | 4 +- tests/Type/ScalarSerializationTest.php | 40 ++--- tests/Type/SchemaTest.php | 4 +- tests/Type/TypeLoaderTest.php | 22 +-- tests/Type/ValidationTest.php | 128 +++++++-------- tests/Utils/AssertValidNameTest.php | 6 +- tests/Utils/AstFromValueTest.php | 26 +-- tests/Utils/AstFromValueUntypedTest.php | 10 +- tests/Utils/BreakingChangesFinderTest.php | 54 +++---- tests/Utils/BuildSchemaTest.php | 100 ++++++------ tests/Utils/CoerceValueTest.php | 52 +++--- tests/Utils/ExtractTypesTest.php | 6 +- tests/Utils/IsValidLiteralValueTest.php | 4 +- tests/Utils/MixedStoreTest.php | 12 +- tests/Utils/QuotedOrListTest.php | 10 +- tests/Utils/SchemaPrinterTest.php | 58 +++---- tests/Utils/SuggestionListTest.php | 6 +- tests/Utils/ValueFromAstTest.php | 26 +-- tests/UtilsTest.php | 2 +- tests/Validator/DisableIntrospectionTest.php | 12 +- tests/Validator/ExecutableDefinitionsTest.php | 6 +- tests/Validator/FieldsOnCorrectTypeTest.php | 50 +++--- .../FragmentsOnCompositeTypesTest.php | 18 +-- tests/Validator/KnownArgumentNamesTest.php | 26 +-- tests/Validator/KnownDirectivesTest.php | 16 +- tests/Validator/KnownFragmentNamesTest.php | 4 +- tests/Validator/KnownTypeNamesTest.php | 6 +- .../Validator/LoneAnonymousOperationTest.php | 14 +- tests/Validator/NoFragmentCyclesTest.php | 30 ++-- tests/Validator/NoUndefinedVariablesTest.php | 34 ++-- tests/Validator/NoUnusedFragmentsTest.php | 10 +- tests/Validator/NoUnusedVariablesTest.php | 24 +-- .../OverlappingFieldsCanBeMergedTest.php | 82 +++++----- .../Validator/PossibleFragmentSpreadsTest.php | 46 +++--- .../ProvidedNonNullArgumentsTest.php | 34 ++-- tests/Validator/QueryComplexityTest.php | 32 ++-- tests/Validator/QueryDepthTest.php | 12 +- tests/Validator/QuerySecurityTestCase.php | 2 +- tests/Validator/ScalarLeafsTest.php | 18 +-- tests/Validator/UniqueArgumentNamesTest.php | 26 +-- .../UniqueDirectivesPerLocationTest.php | 18 +-- tests/Validator/UniqueFragmentNamesTest.php | 14 +- tests/Validator/UniqueInputFieldNamesTest.php | 12 +- tests/Validator/UniqueOperationNamesTest.php | 18 +-- tests/Validator/UniqueVariableNamesTest.php | 4 +- tests/Validator/ValidationTest.php | 6 +- tests/Validator/ValuesOfCorrectTypeTest.php | 152 +++++++++--------- .../Validator/VariablesAreInputTypesTest.php | 4 +- .../VariablesDefaultValueAllowedTest.php | 12 +- .../VariablesInAllowedPositionTest.php | 42 ++--- 91 files changed, 1197 insertions(+), 1216 deletions(-) diff --git a/tests/Executor/AbstractPromiseTest.php b/tests/Executor/AbstractPromiseTest.php index 0ea9a4f..8a6f1d1 100644 --- a/tests/Executor/AbstractPromiseTest.php +++ b/tests/Executor/AbstractPromiseTest.php @@ -21,7 +21,7 @@ class AbstractPromiseTest extends TestCase /** * @see it('isTypeOf used to resolve runtime type for Interface') */ - public function testIsTypeOfUsedToResolveRuntimeTypeForInterface() + public function testIsTypeOfUsedToResolveRuntimeTypeForInterface() : void { $PetType = new InterfaceType([ 'name' => 'Pet', @@ -105,7 +105,7 @@ class AbstractPromiseTest extends TestCase /** * @see it('isTypeOf can be rejected') */ - public function testIsTypeOfCanBeRejected() + public function testIsTypeOfCanBeRejected() : void { $PetType = new InterfaceType([ @@ -199,7 +199,7 @@ class AbstractPromiseTest extends TestCase /** * @see it('isTypeOf used to resolve runtime type for Union') */ - public function testIsTypeOfUsedToResolveRuntimeTypeForUnion() + public function testIsTypeOfUsedToResolveRuntimeTypeForUnion() : void { $DogType = new ObjectType([ @@ -277,7 +277,7 @@ class AbstractPromiseTest extends TestCase /** * @see it('resolveType on Interface yields useful error') */ - public function testResolveTypeOnInterfaceYieldsUsefulError() + public function testResolveTypeOnInterfaceYieldsUsefulError() : void { $PetType = new InterfaceType([ 'name' => 'Pet', @@ -383,7 +383,7 @@ class AbstractPromiseTest extends TestCase /** * @see it('resolveType on Union yields useful error') */ - public function testResolveTypeOnUnionYieldsUsefulError() + public function testResolveTypeOnUnionYieldsUsefulError() : void { $HumanType = new ObjectType([ @@ -484,7 +484,7 @@ class AbstractPromiseTest extends TestCase /** * @see it('resolveType allows resolving with type name') */ - public function testResolveTypeAllowsResolvingWithTypeName() + public function testResolveTypeAllowsResolvingWithTypeName() : void { $PetType = new InterfaceType([ 'name' => 'Pet', @@ -569,7 +569,7 @@ class AbstractPromiseTest extends TestCase /** * @see it('resolveType can be caught') */ - public function testResolveTypeCanBeCaught() + public function testResolveTypeCanBeCaught() : void { $PetType = new InterfaceType([ diff --git a/tests/Executor/AbstractTest.php b/tests/Executor/AbstractTest.php index f6eda0a..38ebd1f 100644 --- a/tests/Executor/AbstractTest.php +++ b/tests/Executor/AbstractTest.php @@ -21,7 +21,7 @@ class AbstractTest extends TestCase /** * @see it('isTypeOf used to resolve runtime type for Interface') */ - public function testIsTypeOfUsedToResolveRuntimeTypeForInterface() + public function testIsTypeOfUsedToResolveRuntimeTypeForInterface() : void { // isTypeOf used to resolve runtime type for Interface $petType = new InterfaceType([ @@ -95,7 +95,7 @@ class AbstractTest extends TestCase /** * @see it('isTypeOf used to resolve runtime type for Union') */ - public function testIsTypeOfUsedToResolveRuntimeTypeForUnion() + public function testIsTypeOfUsedToResolveRuntimeTypeForUnion() : void { $dogType = new ObjectType([ 'name' => 'Dog', @@ -265,7 +265,7 @@ class AbstractTest extends TestCase /** * @see it('resolveType on Union yields useful error') */ - public function testResolveTypeOnUnionYieldsUsefulError() + public function testResolveTypeOnUnionYieldsUsefulError() : void { $HumanType = new ObjectType([ 'name' => 'Human', @@ -360,7 +360,7 @@ class AbstractTest extends TestCase /** * @see it('returning invalid value from resolveType yields useful error') */ - public function testReturningInvalidValueFromResolveTypeYieldsUsefulError() + public function testReturningInvalidValueFromResolveTypeYieldsUsefulError() : void { $fooInterface = new InterfaceType([ 'name' => 'FooInterface', @@ -415,7 +415,7 @@ class AbstractTest extends TestCase /** * @see it('resolveType allows resolving with type name') */ - public function testResolveTypeAllowsResolvingWithTypeName() + public function testResolveTypeAllowsResolvingWithTypeName() : void { $PetType = new InterfaceType([ 'name' => 'Pet', @@ -489,7 +489,7 @@ class AbstractTest extends TestCase ], $result); } - public function testHintsOnConflictingTypeInstancesInResolveType() + public function testHintsOnConflictingTypeInstancesInResolveType() : void { $createTest = function() use (&$iface) { return new ObjectType([ diff --git a/tests/Executor/DeferredFieldsTest.php b/tests/Executor/DeferredFieldsTest.php index 083d24c..775b5ab 100644 --- a/tests/Executor/DeferredFieldsTest.php +++ b/tests/Executor/DeferredFieldsTest.php @@ -180,7 +180,7 @@ class DeferredFieldsTest extends TestCase parent::setUp(); } - public function testDeferredFields() + public function testDeferredFields() : void { $query = Parser::parse(' { @@ -272,7 +272,7 @@ class DeferredFieldsTest extends TestCase $this->assertEquals($expectedPath, $this->path); } - public function testNestedDeferredFields() + public function testNestedDeferredFields() : void { $query = Parser::parse(' { @@ -349,7 +349,7 @@ class DeferredFieldsTest extends TestCase $this->assertEquals($expectedPath, $this->path); } - public function testComplexRecursiveDeferredFields() + public function testComplexRecursiveDeferredFields() : void { $complexType = new ObjectType([ 'name' => 'ComplexType', diff --git a/tests/Executor/DirectivesTest.php b/tests/Executor/DirectivesTest.php index 3b22e21..295e2f1 100644 --- a/tests/Executor/DirectivesTest.php +++ b/tests/Executor/DirectivesTest.php @@ -13,18 +13,14 @@ class DirectivesTest extends TestCase // Describe: Execute: handles directives /** - * @describe works without directives * @see it('basic query works') */ - public function testWorksWithoutDirectives() + public function testWorksWithoutDirectives() : void { $this->assertEquals(['data' => ['a' => 'a', 'b' => 'b']], $this->executeTestQuery('{ a, b }')); } - /** - * @describe works on scalars - */ - public function testWorksOnScalars() + public function testWorksOnScalars() : void { // if true includes scalar $this->assertEquals(['data' => ['a' => 'a', 'b' => 'b']], $this->executeTestQuery('{ a, b @include(if: true) }')); @@ -39,10 +35,7 @@ class DirectivesTest extends TestCase $this->assertEquals(['data' => ['a' => 'a']], $this->executeTestQuery('{ a, b @skip(if: true) }')); } - /** - * @describe works on fragment spreads - */ - public function testWorksOnFragmentSpreads() + public function testWorksOnFragmentSpreads() : void { // if false omits fragment spread $q = ' @@ -93,10 +86,7 @@ class DirectivesTest extends TestCase $this->assertEquals(['data' => ['a' => 'a']], $this->executeTestQuery($q)); } - /** - * @describe works on inline fragment - */ - public function testWorksOnInlineFragment() + public function testWorksOnInlineFragment() : void { // if false omits inline fragment $q = ' @@ -143,10 +133,7 @@ class DirectivesTest extends TestCase $this->assertEquals(['data' => ['a' => 'a']], $this->executeTestQuery($q)); } - /** - * @describe works on anonymous inline fragment - */ - public function testWorksOnAnonymousInlineFragment() + public function testWorksOnAnonymousInlineFragment() : void { // if false omits anonymous inline fragment $q = ' @@ -193,10 +180,7 @@ class DirectivesTest extends TestCase $this->assertEquals(['data' => ['a' => 'a']], $this->executeTestQuery($q)); } - /** - * @describe works with skip and include directives - */ - public function testWorksWithSkipAndIncludeDirectives() + public function testWorksWithSkipAndIncludeDirectives() : void { // include and no skip $this->assertEquals( @@ -217,9 +201,6 @@ class DirectivesTest extends TestCase ); } - - - private static $schema; private static $data; diff --git a/tests/Executor/ExecutionResultTest.php b/tests/Executor/ExecutionResultTest.php index deab57a..69fbd78 100644 --- a/tests/Executor/ExecutionResultTest.php +++ b/tests/Executor/ExecutionResultTest.php @@ -6,14 +6,14 @@ use PHPUnit\Framework\TestCase; class ExecutionResultTest extends TestCase { - public function testToArrayWithoutExtensions() + public function testToArrayWithoutExtensions() : void { $executionResult = new ExecutionResult(); $this->assertEquals([], $executionResult->toArray()); } - public function testToArrayExtensions() + public function testToArrayExtensions() : void { $executionResult = new ExecutionResult(null, [], ['foo' => 'bar']); diff --git a/tests/Executor/ExecutorLazySchemaTest.php b/tests/Executor/ExecutorLazySchemaTest.php index a62091c..d388735 100644 --- a/tests/Executor/ExecutorLazySchemaTest.php +++ b/tests/Executor/ExecutorLazySchemaTest.php @@ -41,7 +41,7 @@ class ExecutorLazySchemaTest extends TestCase public $loadedTypes = []; - public function testWarnsAboutSlowIsTypeOfForLazySchema() + public function testWarnsAboutSlowIsTypeOfForLazySchema() : void { // isTypeOf used to resolve runtime type for Interface $petType = new InterfaceType([ @@ -141,7 +141,7 @@ class ExecutorLazySchemaTest extends TestCase $result->errors[0]->getMessage()); } - public function testHintsOnConflictingTypeInstancesInDefinitions() + public function testHintsOnConflictingTypeInstancesInDefinitions() : void { $calls = []; $typeLoader = function($name) use (&$calls) { @@ -197,7 +197,7 @@ class ExecutorLazySchemaTest extends TestCase ); } - public function testSimpleQuery() + public function testSimpleQuery() : void { $schema = new Schema([ 'query' => $this->loadType('Query'), @@ -225,7 +225,7 @@ class ExecutorLazySchemaTest extends TestCase $this->assertEquals($expectedExecutorCalls, $this->calls); } - public function testDeepQuery() + public function testDeepQuery() : void { $schema = new Schema([ 'query' => $this->loadType('Query'), @@ -261,7 +261,7 @@ class ExecutorLazySchemaTest extends TestCase $this->assertEquals($expectedExecutorCalls, $this->calls); } - public function testResolveUnion() + public function testResolveUnion() : void { $schema = new Schema([ 'query' => $this->loadType('Query'), diff --git a/tests/Executor/ExecutorSchemaTest.php b/tests/Executor/ExecutorSchemaTest.php index 54c153b..5c62b09 100644 --- a/tests/Executor/ExecutorSchemaTest.php +++ b/tests/Executor/ExecutorSchemaTest.php @@ -15,7 +15,7 @@ class ExecutorSchemaTest extends TestCase /** * @see it('executes using a schema') */ - public function testExecutesUsingASchema() + public function testExecutesUsingASchema() : void { $BlogArticle = null; $BlogImage = new ObjectType([ diff --git a/tests/Executor/ExecutorTest.php b/tests/Executor/ExecutorTest.php index 4fa7efb..de63db2 100644 --- a/tests/Executor/ExecutorTest.php +++ b/tests/Executor/ExecutorTest.php @@ -28,7 +28,7 @@ class ExecutorTest extends TestCase /** * @see it('executes arbitrary code') */ - public function testExecutesArbitraryCode() + public function testExecutesArbitraryCode() : void { $deepData = null; $data = null; @@ -166,7 +166,7 @@ class ExecutorTest extends TestCase /** * @see it('merges parallel fragments') */ - public function testMergesParallelFragments() + public function testMergesParallelFragments() : void { $ast = Parser::parse(' { a, ...FragOne, ...FragTwo } @@ -227,7 +227,7 @@ class ExecutorTest extends TestCase /** * @see it('provides info about current execution state') */ - public function testProvidesInfoAboutCurrentExecutionState() + public function testProvidesInfoAboutCurrentExecutionState() : void { $ast = Parser::parse('query ($var: String) { result: test }'); @@ -279,7 +279,7 @@ class ExecutorTest extends TestCase /** * @see it('threads root value context correctly') */ - public function testThreadsContextCorrectly() + public function testThreadsContextCorrectly() : void { // threads context correctly $doc = 'query Example { a }'; @@ -313,7 +313,7 @@ class ExecutorTest extends TestCase /** * @see it('correctly threads arguments') */ - public function testCorrectlyThreadsArguments() + public function testCorrectlyThreadsArguments() : void { $doc = ' query Example { @@ -350,7 +350,7 @@ class ExecutorTest extends TestCase /** * @see it('nulls out error subtrees') */ - public function testNullsOutErrorSubtrees() + public function testNullsOutErrorSubtrees() : void { $doc = '{ sync @@ -528,7 +528,7 @@ class ExecutorTest extends TestCase /** * @see it('uses the inline operation if no operation name is provided') */ - public function testUsesTheInlineOperationIfNoOperationIsProvided() + public function testUsesTheInlineOperationIfNoOperationIsProvided() : void { $doc = '{ a }'; $data = ['a' => 'b']; @@ -550,7 +550,7 @@ class ExecutorTest extends TestCase /** * @see it('uses the only operation if no operation name is provided') */ - public function testUsesTheOnlyOperationIfNoOperationIsProvided() + public function testUsesTheOnlyOperationIfNoOperationIsProvided() : void { $doc = 'query Example { a }'; $data = [ 'a' => 'b' ]; @@ -571,7 +571,7 @@ class ExecutorTest extends TestCase /** * @see it('uses the named operation if operation name is provided') */ - public function testUsesTheNamedOperationIfOperationNameIsProvided() + public function testUsesTheNamedOperationIfOperationNameIsProvided() : void { $doc = 'query Example { first: a } query OtherExample { second: a }'; $data = [ 'a' => 'b' ]; @@ -592,7 +592,7 @@ class ExecutorTest extends TestCase /** * @see it('provides error if no operation is provided') */ - public function testProvidesErrorIfNoOperationIsProvided() + public function testProvidesErrorIfNoOperationIsProvided() : void { $doc = 'fragment Example on Type { a }'; $data = [ 'a' => 'b' ]; @@ -621,7 +621,7 @@ class ExecutorTest extends TestCase /** * @see it('errors if no op name is provided with multiple operations') */ - public function testErrorsIfNoOperationIsProvidedWithMultipleOperations() + public function testErrorsIfNoOperationIsProvidedWithMultipleOperations() : void { $doc = 'query Example { a } query OtherExample { a }'; $data = ['a' => 'b']; @@ -651,7 +651,7 @@ class ExecutorTest extends TestCase /** * @see it('errors if unknown operation name is provided') */ - public function testErrorsIfUnknownOperationNameIsProvided() + public function testErrorsIfUnknownOperationNameIsProvided() : void { $doc = 'query Example { a } query OtherExample { a }'; $ast = Parser::parse($doc); @@ -689,7 +689,7 @@ class ExecutorTest extends TestCase /** * @see it('uses the query schema for queries') */ - public function testUsesTheQuerySchemaForQueries() + public function testUsesTheQuerySchemaForQueries() : void { $doc = 'query Q { a } mutation M { c }'; $data = ['a' => 'b', 'c' => 'd']; @@ -716,7 +716,7 @@ class ExecutorTest extends TestCase /** * @see it('uses the mutation schema for mutations') */ - public function testUsesTheMutationSchemaForMutations() + public function testUsesTheMutationSchemaForMutations() : void { $doc = 'query Q { a } mutation M { c }'; $data = [ 'a' => 'b', 'c' => 'd' ]; @@ -742,7 +742,7 @@ class ExecutorTest extends TestCase /** * @see it('uses the subscription schema for subscriptions') */ - public function testUsesTheSubscriptionSchemaForSubscriptions() + public function testUsesTheSubscriptionSchemaForSubscriptions() : void { $doc = 'query Q { a } subscription S { a }'; $data = [ 'a' => 'b', 'c' => 'd' ]; @@ -766,7 +766,7 @@ class ExecutorTest extends TestCase $this->assertEquals(['data' => ['a' => 'b']], $subscriptionResult->toArray()); } - public function testCorrectFieldOrderingDespiteExecutionOrder() + public function testCorrectFieldOrderingDespiteExecutionOrder() : void { $doc = '{ a, @@ -823,7 +823,7 @@ class ExecutorTest extends TestCase /** * @see it('Avoids recursion') */ - public function testAvoidsRecursion() + public function testAvoidsRecursion() : void { $doc = ' query Q { @@ -855,7 +855,7 @@ class ExecutorTest extends TestCase /** * @see it('does not include illegal fields in output') */ - public function testDoesNotIncludeIllegalFieldsInOutput() + public function testDoesNotIncludeIllegalFieldsInOutput() : void { $doc = 'mutation M { thisIsIllegalDontIncludeMe @@ -882,7 +882,7 @@ class ExecutorTest extends TestCase /** * @see it('does not include arguments that were not set') */ - public function testDoesNotIncludeArgumentsThatWereNotSet() + public function testDoesNotIncludeArgumentsThatWereNotSet() : void { $schema = new Schema([ 'query' => new ObjectType([ @@ -917,7 +917,7 @@ class ExecutorTest extends TestCase /** * @see it('fails when an isTypeOf check is not met') */ - public function testFailsWhenAnIsTypeOfCheckIsNotMet() + public function testFailsWhenAnIsTypeOfCheckIsNotMet() : void { $SpecialType = new ObjectType([ 'name' => 'SpecialType', @@ -967,7 +967,7 @@ class ExecutorTest extends TestCase /** * @see it('executes ignoring invalid non-executable definitions') */ - public function testExecutesIgnoringInvalidNonExecutableDefinitions() + public function testExecutesIgnoringInvalidNonExecutableDefinitions() : void { $query = Parser::parse(' { foo } @@ -999,7 +999,7 @@ class ExecutorTest extends TestCase /** * @see it('uses a custom field resolver') */ - public function testUsesACustomFieldResolver() + public function testUsesACustomFieldResolver() : void { $query = Parser::parse('{ foo }'); @@ -1034,7 +1034,7 @@ class ExecutorTest extends TestCase $this->assertEquals($expected, $result->toArray()); } - public function testSubstitutesArgumentWithDefaultValue() + public function testSubstitutesArgumentWithDefaultValue() : void { $schema = new Schema([ 'query' => new ObjectType([ @@ -1078,7 +1078,7 @@ class ExecutorTest extends TestCase /** * @see https://github.com/webonyx/graphql-php/issues/59 */ - public function testSerializesToEmptyObjectVsEmptyArray() + public function testSerializesToEmptyObjectVsEmptyArray() : void { $iface = null; diff --git a/tests/Executor/LazyInterfaceTest.php b/tests/Executor/LazyInterfaceTest.php index 73af88e..a099187 100644 --- a/tests/Executor/LazyInterfaceTest.php +++ b/tests/Executor/LazyInterfaceTest.php @@ -102,7 +102,7 @@ class LazyInterfaceTest extends TestCase /** * Handles execution of a lazily created interface */ - public function testReturnsFragmentsWithLazyCreatedInterface() + public function testReturnsFragmentsWithLazyCreatedInterface() : void { $request = ' { diff --git a/tests/Executor/ListsTest.php b/tests/Executor/ListsTest.php index f691a20..3ab1406 100644 --- a/tests/Executor/ListsTest.php +++ b/tests/Executor/ListsTest.php @@ -18,9 +18,9 @@ class ListsTest extends TestCase // Describe: Execute: Handles list nullability /** - * @describe [T] + * [T] */ - public function testHandlesNullableListsWithArray() + public function testHandlesNullableListsWithArray() : void { // Contains values $this->checkHandlesNullableLists( @@ -42,9 +42,9 @@ class ListsTest extends TestCase } /** - * @describe [T] + * [T] */ - public function testHandlesNullableListsWithPromiseArray() + public function testHandlesNullableListsWithPromiseArray() : void { // Contains values $this->checkHandlesNullableLists( @@ -91,9 +91,9 @@ class ListsTest extends TestCase } /** - * @describe [T] + * [T] */ - public function testHandlesNullableListsWithArrayPromise() + public function testHandlesNullableListsWithArrayPromise() : void { // Contains values $this->checkHandlesNullableLists( @@ -154,9 +154,9 @@ class ListsTest extends TestCase } /** - * @describe [T]! + * [T]! */ - public function testHandlesNonNullableListsWithArray() + public function testHandlesNonNullableListsWithArray() : void { // Contains values $this->checkHandlesNonNullableLists( @@ -187,9 +187,9 @@ class ListsTest extends TestCase } /** - * @describe [T]! + * [T]! */ - public function testHandlesNonNullableListsWithPromiseArray() + public function testHandlesNonNullableListsWithPromiseArray() : void { // Contains values $this->checkHandlesNonNullableLists( @@ -243,9 +243,9 @@ class ListsTest extends TestCase } /** - * @describe [T]! + * [T]! */ - public function testHandlesNonNullableListsWithArrayPromise() + public function testHandlesNonNullableListsWithArrayPromise() : void { // Contains values $this->checkHandlesNonNullableLists( @@ -305,9 +305,9 @@ class ListsTest extends TestCase } /** - * @describe [T!] + * [T!] */ - public function testHandlesListOfNonNullsWithArray() + public function testHandlesListOfNonNullsWithArray() : void { // Contains values $this->checkHandlesListOfNonNulls( @@ -338,9 +338,9 @@ class ListsTest extends TestCase } /** - * @describe [T!] + * [T!] */ - public function testHandlesListOfNonNullsWithPromiseArray() + public function testHandlesListOfNonNullsWithPromiseArray() : void { // Contains values $this->checkHandlesListOfNonNulls( @@ -396,9 +396,9 @@ class ListsTest extends TestCase } /** - * @describe [T]! + * [T]! */ - public function testHandlesListOfNonNullsWithArrayPromise() + public function testHandlesListOfNonNullsWithArrayPromise() : void { // Contains values $this->checkHandlesListOfNonNulls( @@ -452,9 +452,9 @@ class ListsTest extends TestCase } /** - * @describe [T!]! + * [T!]! */ - public function testHandlesNonNullListOfNonNullsWithArray() + public function testHandlesNonNullListOfNonNullsWithArray() : void { // Contains values $this->checkHandlesNonNullListOfNonNulls( @@ -495,9 +495,9 @@ class ListsTest extends TestCase } /** - * @describe [T!]! + * [T!]! */ - public function testHandlesNonNullListOfNonNullsWithPromiseArray() + public function testHandlesNonNullListOfNonNullsWithPromiseArray() : void { // Contains values $this->checkHandlesNonNullListOfNonNulls( @@ -562,9 +562,9 @@ class ListsTest extends TestCase } /** - * @describe [T!]! + * [T!]! */ - public function testHandlesNonNullListOfNonNullsWithArrayPromise() + public function testHandlesNonNullListOfNonNullsWithArrayPromise() : void { // Contains values $this->checkHandlesNonNullListOfNonNulls( diff --git a/tests/Executor/MutationsTest.php b/tests/Executor/MutationsTest.php index 0abe2d6..bc83b5d 100644 --- a/tests/Executor/MutationsTest.php +++ b/tests/Executor/MutationsTest.php @@ -19,7 +19,7 @@ class MutationsTest extends TestCase /** * @see it('evaluates mutations serially') */ - public function testEvaluatesMutationsSerially() + public function testEvaluatesMutationsSerially() : void { $doc = 'mutation M { first: immediatelyChangeTheNumber(newNumber: 1) { @@ -65,7 +65,7 @@ class MutationsTest extends TestCase /** * @see it('evaluates mutations correctly in the presense of a failed mutation') */ - public function testEvaluatesMutationsCorrectlyInThePresenseOfAFailedMutation() + public function testEvaluatesMutationsCorrectlyInThePresenseOfAFailedMutation() : void { $doc = 'mutation M { first: immediatelyChangeTheNumber(newNumber: 1) { diff --git a/tests/Executor/NonNullTest.php b/tests/Executor/NonNullTest.php index c93a041..2d2a528 100644 --- a/tests/Executor/NonNullTest.php +++ b/tests/Executor/NonNullTest.php @@ -132,7 +132,7 @@ class NonNullTest extends TestCase /** * @see it('nulls a nullable field that throws synchronously') */ - public function testNullsANullableFieldThatThrowsSynchronously() + public function testNullsANullableFieldThatThrowsSynchronously() : void { $doc = ' query Q { @@ -156,7 +156,7 @@ class NonNullTest extends TestCase $this->assertArraySubset($expected, Executor::execute($this->schema, $ast, $this->throwingData, null, [], 'Q')->toArray()); } - public function testNullsANullableFieldThatThrowsInAPromise() + public function testNullsANullableFieldThatThrowsInAPromise() : void { $doc = ' query Q { @@ -181,7 +181,7 @@ class NonNullTest extends TestCase $this->assertArraySubset($expected, Executor::execute($this->schema, $ast, $this->throwingData, null, [], 'Q')->toArray()); } - public function testNullsASynchronouslyReturnedObjectThatContainsANonNullableFieldThatThrowsSynchronously() + public function testNullsASynchronouslyReturnedObjectThatContainsANonNullableFieldThatThrowsSynchronously() : void { // nulls a synchronously returned object that contains a non-nullable field that throws synchronously $doc = ' @@ -205,7 +205,7 @@ class NonNullTest extends TestCase $this->assertArraySubset($expected, Executor::execute($this->schema, $ast, $this->throwingData, null, [], 'Q')->toArray()); } - public function testNullsAsynchronouslyReturnedObjectThatContainsANonNullableFieldThatThrowsInAPromise() + public function testNullsAsynchronouslyReturnedObjectThatContainsANonNullableFieldThatThrowsInAPromise() : void { $doc = ' query Q { @@ -229,7 +229,7 @@ class NonNullTest extends TestCase $this->assertArraySubset($expected, Executor::execute($this->schema, $ast, $this->throwingData, null, [], 'Q')->toArray()); } - public function testNullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatThrowsSynchronously() + public function testNullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatThrowsSynchronously() : void { $doc = ' query Q { @@ -253,7 +253,7 @@ class NonNullTest extends TestCase $this->assertArraySubset($expected, Executor::execute($this->schema, $ast, $this->throwingData, null, [], 'Q')->toArray()); } - public function testNullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatThrowsInAPromise() + public function testNullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatThrowsInAPromise() : void { $doc = ' query Q { @@ -280,7 +280,7 @@ class NonNullTest extends TestCase /** * @see it('nulls a complex tree of nullable fields that throw') */ - public function testNullsAComplexTreeOfNullableFieldsThatThrow() + public function testNullsAComplexTreeOfNullableFieldsThatThrow() : void { $doc = ' query Q { @@ -359,7 +359,7 @@ class NonNullTest extends TestCase $this->assertArraySubset($expected, Executor::execute($this->schema, $ast, $this->throwingData, null, [], 'Q')->toArray()); } - public function testNullsTheFirstNullableObjectAfterAFieldThrowsInALongChainOfFieldsThatAreNonNull() + public function testNullsTheFirstNullableObjectAfterAFieldThrowsInALongChainOfFieldsThatAreNonNull() : void { $doc = ' query Q { @@ -430,7 +430,7 @@ class NonNullTest extends TestCase $this->assertArraySubset($expected, Executor::execute($this->schema, $ast, $this->throwingData, null, [], 'Q')->toArray()); } - public function testNullsANullableFieldThatSynchronouslyReturnsNull() + public function testNullsANullableFieldThatSynchronouslyReturnsNull() : void { $doc = ' query Q { @@ -448,7 +448,7 @@ class NonNullTest extends TestCase $this->assertEquals($expected, Executor::execute($this->schema, $ast, $this->nullingData, null, [], 'Q')->toArray()); } - public function testNullsANullableFieldThatReturnsNullInAPromise() + public function testNullsANullableFieldThatReturnsNullInAPromise() : void { $doc = ' query Q { @@ -467,7 +467,7 @@ class NonNullTest extends TestCase $this->assertArraySubset($expected, Executor::execute($this->schema, $ast, $this->nullingData, null, [], 'Q')->toArray()); } - public function testNullsASynchronouslyReturnedObjectThatContainsANonNullableFieldThatReturnsNullSynchronously() + public function testNullsASynchronouslyReturnedObjectThatContainsANonNullableFieldThatReturnsNullSynchronously() : void { $doc = ' query Q { @@ -493,7 +493,7 @@ class NonNullTest extends TestCase $this->assertArraySubset($expected, Executor::execute($this->schema, $ast, $this->nullingData, null, [], 'Q')->toArray(true)); } - public function testNullsASynchronouslyReturnedObjectThatContainsANonNullableFieldThatReturnsNullInAPromise() + public function testNullsASynchronouslyReturnedObjectThatContainsANonNullableFieldThatReturnsNullInAPromise() : void { $doc = ' query Q { @@ -523,7 +523,7 @@ class NonNullTest extends TestCase ); } - public function testNullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatReturnsNullSynchronously() + public function testNullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatReturnsNullSynchronously() : void { $doc = ' query Q { @@ -553,7 +553,7 @@ class NonNullTest extends TestCase ); } - public function testNullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatReturnsNullInaAPromise() + public function testNullsAnObjectReturnedInAPromiseThatContainsANonNullableFieldThatReturnsNullInaAPromise() : void { $doc = ' query Q { @@ -583,7 +583,7 @@ class NonNullTest extends TestCase ); } - public function testNullsAComplexTreeOfNullableFieldsThatReturnNull() + public function testNullsAComplexTreeOfNullableFieldsThatReturnNull() : void { $doc = ' query Q { @@ -649,7 +649,7 @@ class NonNullTest extends TestCase $this->assertEquals($expected, $actual); } - public function testNullsTheFirstNullableObjectAfterAFieldReturnsNullInALongChainOfFieldsThatAreNonNull() + public function testNullsTheFirstNullableObjectAfterAFieldReturnsNullInALongChainOfFieldsThatAreNonNull() : void { $doc = ' query Q { @@ -726,7 +726,7 @@ class NonNullTest extends TestCase /** * @see it('nulls the top level if sync non-nullable field throws') */ - public function testNullsTheTopLevelIfSyncNonNullableFieldThrows() + public function testNullsTheTopLevelIfSyncNonNullableFieldThrows() : void { $doc = ' query Q { syncNonNull } @@ -741,7 +741,7 @@ class NonNullTest extends TestCase $this->assertArraySubset($expected, $actual); } - public function testNullsTheTopLevelIfAsyncNonNullableFieldErrors() + public function testNullsTheTopLevelIfAsyncNonNullableFieldErrors() : void { $doc = ' query Q { promiseNonNull } @@ -758,7 +758,7 @@ class NonNullTest extends TestCase $this->assertArraySubset($expected, Executor::execute($this->schema, $ast, $this->throwingData, null, [], 'Q')->toArray()); } - public function testNullsTheTopLevelIfSyncNonNullableFieldReturnsNull() + public function testNullsTheTopLevelIfSyncNonNullableFieldReturnsNull() : void { // nulls the top level if sync non-nullable field returns null $doc = ' @@ -779,7 +779,7 @@ class NonNullTest extends TestCase ); } - public function testNullsTheTopLevelIfAsyncNonNullableFieldResolvesNull() + public function testNullsTheTopLevelIfAsyncNonNullableFieldResolvesNull() : void { $doc = ' query Q { promiseNonNull } diff --git a/tests/Executor/Promise/ReactPromiseAdapterTest.php b/tests/Executor/Promise/ReactPromiseAdapterTest.php index 294c11f..6859aeb 100644 --- a/tests/Executor/Promise/ReactPromiseAdapterTest.php +++ b/tests/Executor/Promise/ReactPromiseAdapterTest.php @@ -25,7 +25,7 @@ class ReactPromiseAdapterTest extends TestCase } } - public function testIsThenableReturnsTrueWhenAReactPromiseIsGiven() + public function testIsThenableReturnsTrueWhenAReactPromiseIsGiven() : void { $reactAdapter = new ReactPromiseAdapter(); @@ -43,7 +43,7 @@ class ReactPromiseAdapterTest extends TestCase $this->assertSame(false, $reactAdapter->isThenable(new \stdClass())); } - public function testConvertsReactPromisesToGraphQlOnes() + public function testConvertsReactPromisesToGraphQlOnes() : void { $reactAdapter = new ReactPromiseAdapter(); $reactPromise = new FulfilledPromise(1); @@ -54,7 +54,7 @@ class ReactPromiseAdapterTest extends TestCase $this->assertInstanceOf('React\Promise\FulfilledPromise', $promise->adoptedPromise); } - public function testThen() + public function testThen() : void { $reactAdapter = new ReactPromiseAdapter(); $reactPromise = new FulfilledPromise(1); @@ -71,7 +71,7 @@ class ReactPromiseAdapterTest extends TestCase $this->assertInstanceOf('React\Promise\FulfilledPromise', $resultPromise->adoptedPromise); } - public function testCreate() + public function testCreate() : void { $reactAdapter = new ReactPromiseAdapter(); $resolvedPromise = $reactAdapter->create(function ($resolve) { @@ -90,7 +90,7 @@ class ReactPromiseAdapterTest extends TestCase $this->assertSame(1, $result); } - public function testCreateFulfilled() + public function testCreateFulfilled() : void { $reactAdapter = new ReactPromiseAdapter(); $fulfilledPromise = $reactAdapter->createFulfilled(1); @@ -107,7 +107,7 @@ class ReactPromiseAdapterTest extends TestCase $this->assertSame(1, $result); } - public function testCreateRejected() + public function testCreateRejected() : void { $reactAdapter = new ReactPromiseAdapter(); $rejectedPromise = $reactAdapter->createRejected(new \Exception('I am a bad promise')); @@ -125,7 +125,7 @@ class ReactPromiseAdapterTest extends TestCase $this->assertEquals('I am a bad promise', $exception->getMessage()); } - public function testAll() + public function testAll() : void { $reactAdapter = new ReactPromiseAdapter(); $promises = [new FulfilledPromise(1), new FulfilledPromise(2), new FulfilledPromise(3)]; @@ -144,7 +144,7 @@ class ReactPromiseAdapterTest extends TestCase $this->assertSame([1, 2, 3], $result); } - public function testAllShouldPreserveTheOrderOfTheArrayWhenResolvingAsyncPromises() + public function testAllShouldPreserveTheOrderOfTheArrayWhenResolvingAsyncPromises() : void { $reactAdapter = new ReactPromiseAdapter(); $deferred = new Deferred(); diff --git a/tests/Executor/Promise/SyncPromiseAdapterTest.php b/tests/Executor/Promise/SyncPromiseAdapterTest.php index 5aabf9d..bbe838b 100644 --- a/tests/Executor/Promise/SyncPromiseAdapterTest.php +++ b/tests/Executor/Promise/SyncPromiseAdapterTest.php @@ -20,7 +20,7 @@ class SyncPromiseAdapterTest extends TestCase $this->promises = new SyncPromiseAdapter(); } - public function testIsThenable() + public function testIsThenable() : void { $this->assertEquals(true, $this->promises->isThenable(new Deferred(function() {}))); $this->assertEquals(false, $this->promises->isThenable(false)); @@ -33,7 +33,7 @@ class SyncPromiseAdapterTest extends TestCase $this->assertEquals(false, $this->promises->isThenable(new \stdClass())); } - public function testConvert() + public function testConvert() : void { $dfd = new Deferred(function() {}); $result = $this->promises->convertThenable($dfd); @@ -46,7 +46,7 @@ class SyncPromiseAdapterTest extends TestCase $this->promises->convertThenable(''); } - public function testThen() + public function testThen() : void { $dfd = new Deferred(function() {}); $promise = $this->promises->convertThenable($dfd); @@ -57,7 +57,7 @@ class SyncPromiseAdapterTest extends TestCase $this->assertInstanceOf('GraphQL\Executor\Promise\Adapter\SyncPromise', $result->adoptedPromise); } - public function testCreatePromise() + public function testCreatePromise() : void { $promise = $this->promises->create(function($resolve, $reject) {}); @@ -71,19 +71,19 @@ class SyncPromiseAdapterTest extends TestCase $this->assertValidPromise($promise, null, 'A', SyncPromise::FULFILLED); } - public function testCreateFulfilledPromise() + public function testCreateFulfilledPromise() : void { $promise = $this->promises->createFulfilled('test'); $this->assertValidPromise($promise, null, 'test', SyncPromise::FULFILLED); } - public function testCreateRejectedPromise() + public function testCreateRejectedPromise() : void { $promise = $this->promises->createRejected(new \Exception('test reason')); $this->assertValidPromise($promise, 'test reason', null, SyncPromise::REJECTED); } - public function testCreatePromiseAll() + public function testCreatePromiseAll() : void { $promise = $this->promises->all([]); $this->assertValidPromise($promise, null, [], SyncPromise::FULFILLED); @@ -117,7 +117,7 @@ class SyncPromiseAdapterTest extends TestCase $this->assertValidPromise($promise, null, ['1', 'value1', 'value2', 3, 'value2-value3', []], SyncPromise::FULFILLED); } - public function testWait() + public function testWait() : void { $called = []; diff --git a/tests/Executor/Promise/SyncPromiseTest.php b/tests/Executor/Promise/SyncPromiseTest.php index d8f0840..6c878aa 100644 --- a/tests/Executor/Promise/SyncPromiseTest.php +++ b/tests/Executor/Promise/SyncPromiseTest.php @@ -258,7 +258,7 @@ class SyncPromiseTest extends TestCase $this->assertValidPromise($nextPromise3, $expectedNextReason, $expectedNextValue, $expectedNextState); } - public function testPendingPromise() + public function testPendingPromise() : void { $promise = new SyncPromise(); $this->assertEquals(SyncPromise::PENDING, $promise->state); @@ -319,7 +319,7 @@ class SyncPromiseTest extends TestCase $this->assertValidPromise($promise2, "Rejected Once Again", null, SyncPromise::REJECTED); } - public function testPendingPromiseThen() + public function testPendingPromiseThen() : void { $promise = new SyncPromise(); $this->assertEquals(SyncPromise::PENDING, $promise->state); diff --git a/tests/Executor/ResolveTest.php b/tests/Executor/ResolveTest.php index b5f6288..0d05e53 100644 --- a/tests/Executor/ResolveTest.php +++ b/tests/Executor/ResolveTest.php @@ -28,7 +28,7 @@ class ResolveTest extends TestCase /** * @see it('default function accesses properties') */ - public function testDefaultFunctionAccessesProperties() + public function testDefaultFunctionAccessesProperties() : void { $schema = $this->buildSchema(['type' => Type::string()]); @@ -45,7 +45,7 @@ class ResolveTest extends TestCase /** * @see it('default function calls methods') */ - public function testDefaultFunctionCallsClosures() + public function testDefaultFunctionCallsClosures() : void { $schema = $this->buildSchema(['type' => Type::string()]); $_secret = 'secretValue' . uniqid(); @@ -64,7 +64,7 @@ class ResolveTest extends TestCase /** * @see it('default function passes args and context') */ - public function testDefaultFunctionPassesArgsAndContext() + public function testDefaultFunctionPassesArgsAndContext() : void { $schema = $this->buildSchema([ 'type' => Type::int(), @@ -82,7 +82,7 @@ class ResolveTest extends TestCase /** * @see it('uses provided resolve function') */ - public function testUsesProvidedResolveFunction() + public function testUsesProvidedResolveFunction() : void { $schema = $this->buildSchema([ 'type' => Type::string(), diff --git a/tests/Executor/SyncTest.php b/tests/Executor/SyncTest.php index 988c8a6..3c1c989 100644 --- a/tests/Executor/SyncTest.php +++ b/tests/Executor/SyncTest.php @@ -68,7 +68,7 @@ class SyncTest extends TestCase /** * @see it('does not return a Promise for initial errors') */ - public function testDoesNotReturnAPromiseForInitialErrors() + public function testDoesNotReturnAPromiseForInitialErrors() : void { $doc = 'fragment Example on Query { syncField }'; $result = $this->execute( @@ -82,7 +82,7 @@ class SyncTest extends TestCase /** * @see it('does not return a Promise if fields are all synchronous') */ - public function testDoesNotReturnAPromiseIfFieldsAreAllSynchronous() + public function testDoesNotReturnAPromiseIfFieldsAreAllSynchronous() : void { $doc = 'query Example { syncField }'; $result = $this->execute( @@ -96,7 +96,7 @@ class SyncTest extends TestCase /** * @see it('does not return a Promise if mutation fields are all synchronous') */ - public function testDoesNotReturnAPromiseIfMutationFieldsAreAllSynchronous() + public function testDoesNotReturnAPromiseIfMutationFieldsAreAllSynchronous() : void { $doc = 'mutation Example { syncMutationField }'; $result = $this->execute( @@ -110,7 +110,7 @@ class SyncTest extends TestCase /** * @see it('returns a Promise if any field is asynchronous') */ - public function testReturnsAPromiseIfAnyFieldIsAsynchronous() + public function testReturnsAPromiseIfAnyFieldIsAsynchronous() : void { $doc = 'query Example { syncField, asyncField }'; $result = $this->execute( @@ -126,7 +126,7 @@ class SyncTest extends TestCase /** * @see it('does not return a Promise for syntax errors') */ - public function testDoesNotReturnAPromiseForSyntaxErrors() + public function testDoesNotReturnAPromiseForSyntaxErrors() : void { $doc = 'fragment Example on Query { { { syncField }'; $result = $this->graphqlSync( @@ -144,7 +144,7 @@ class SyncTest extends TestCase /** * @see it('does not return a Promise for validation errors') */ - public function testDoesNotReturnAPromiseForValidationErrors() + public function testDoesNotReturnAPromiseForValidationErrors() : void { $doc = 'fragment Example on Query { unknownField }'; $validationErrors = DocumentValidator::validate($this->schema, Parser::parse($doc)); @@ -163,7 +163,7 @@ class SyncTest extends TestCase /** * @see it('does not return a Promise for sync execution') */ - public function testDoesNotReturnAPromiseForSyncExecution() + public function testDoesNotReturnAPromiseForSyncExecution() : void { $doc = 'query Example { syncField }'; $result = $this->graphqlSync( diff --git a/tests/Executor/UnionInterfaceTest.php b/tests/Executor/UnionInterfaceTest.php index 59919a6..4d1d934 100644 --- a/tests/Executor/UnionInterfaceTest.php +++ b/tests/Executor/UnionInterfaceTest.php @@ -99,7 +99,7 @@ class UnionInterfaceTest extends TestCase /** * @see it('can introspect on union and intersection types') */ - public function testCanIntrospectOnUnionAndIntersectionTypes() + public function testCanIntrospectOnUnionAndIntersectionTypes() : void { $ast = Parser::parse(' @@ -162,7 +162,7 @@ class UnionInterfaceTest extends TestCase /** * @see it('executes using union types') */ - public function testExecutesUsingUnionTypes() + public function testExecutesUsingUnionTypes() : void { // NOTE: This is an *invalid* query, but it should be an *executable* query. $ast = Parser::parse(' @@ -194,7 +194,7 @@ class UnionInterfaceTest extends TestCase /** * @see it('executes union types with inline fragments') */ - public function testExecutesUnionTypesWithInlineFragments() + public function testExecutesUnionTypesWithInlineFragments() : void { // This is the valid version of the query in the above test. $ast = Parser::parse(' @@ -231,7 +231,7 @@ class UnionInterfaceTest extends TestCase /** * @see it('executes using interface types') */ - public function testExecutesUsingInterfaceTypes() + public function testExecutesUsingInterfaceTypes() : void { // NOTE: This is an *invalid* query, but it should be an *executable* query. $ast = Parser::parse(' @@ -263,7 +263,7 @@ class UnionInterfaceTest extends TestCase /** * @see it('executes interface types with inline fragments') */ - public function testExecutesInterfaceTypesWithInlineFragments() + public function testExecutesInterfaceTypesWithInlineFragments() : void { // This is the valid version of the query in the above test. $ast = Parser::parse(' @@ -299,7 +299,7 @@ class UnionInterfaceTest extends TestCase /** * @see it('allows fragment conditions to be abstract types') */ - public function testAllowsFragmentConditionsToBeAbstractTypes() + public function testAllowsFragmentConditionsToBeAbstractTypes() : void { $ast = Parser::parse(' { @@ -354,7 +354,7 @@ class UnionInterfaceTest extends TestCase /** * @see it('gets execution info in resolver') */ - public function testGetsExecutionInfoInResolver() + public function testGetsExecutionInfoInResolver() : void { $encounteredContext = null; $encounteredSchema = null; diff --git a/tests/Executor/ValuesTest.php b/tests/Executor/ValuesTest.php index 4f8f8fa..4d7bf2d 100644 --- a/tests/Executor/ValuesTest.php +++ b/tests/Executor/ValuesTest.php @@ -13,7 +13,7 @@ use PHPUnit\Framework\TestCase; class ValuesTest extends TestCase { - public function testGetIDVariableValues() + public function testGetIDVariableValues() : void { $this->expectInputVariablesMatchOutputVariables(['idInput' => '123456789']); $this->assertEquals( @@ -23,13 +23,13 @@ class ValuesTest extends TestCase ); } - public function testGetBooleanVariableValues() + public function testGetBooleanVariableValues() : void { $this->expectInputVariablesMatchOutputVariables(['boolInput' => true]); $this->expectInputVariablesMatchOutputVariables(['boolInput' => false]); } - public function testGetIntVariableValues() + public function testGetIntVariableValues() : void { $this->expectInputVariablesMatchOutputVariables(['intInput' => -1]); $this->expectInputVariablesMatchOutputVariables(['intInput' => 0]); @@ -40,7 +40,7 @@ class ValuesTest extends TestCase $this->expectInputVariablesMatchOutputVariables(['intInput' => -2147483648]); } - public function testGetStringVariableValues() + public function testGetStringVariableValues() : void { $this->expectInputVariablesMatchOutputVariables(['stringInput' => 'meow']); $this->expectInputVariablesMatchOutputVariables(['stringInput' => '']); @@ -50,7 +50,7 @@ class ValuesTest extends TestCase $this->expectInputVariablesMatchOutputVariables(['stringInput' => '1.2']); } - public function testGetFloatVariableValues() + public function testGetFloatVariableValues() : void { $this->expectInputVariablesMatchOutputVariables(['floatInput' => 1.2]); $this->expectInputVariablesMatchOutputVariables(['floatInput' => 1.0]); @@ -59,42 +59,42 @@ class ValuesTest extends TestCase $this->expectInputVariablesMatchOutputVariables(['floatInput' => 1e3]); } - public function testBooleanForIDVariableThrowsError() + public function testBooleanForIDVariableThrowsError() : void { $this->expectGraphQLError(['idInput' => true]); } - public function testFloatForIDVariableThrowsError() + public function testFloatForIDVariableThrowsError() : void { $this->expectGraphQLError(['idInput' => 1.0]); } - public function testStringForBooleanVariableThrowsError() + public function testStringForBooleanVariableThrowsError() : void { $this->expectGraphQLError(['boolInput' => 'true']); } - public function testIntForBooleanVariableThrowsError() + public function testIntForBooleanVariableThrowsError() : void { $this->expectGraphQLError(['boolInput' => 1]); } - public function testFloatForBooleanVariableThrowsError() + public function testFloatForBooleanVariableThrowsError() : void { $this->expectGraphQLError(['boolInput' => 1.0]); } - public function testStringForIntVariableThrowsError() + public function testStringForIntVariableThrowsError() : void { $this->expectGraphQLError(['intInput' => 'true']); } - public function testPositiveBigIntForIntVariableThrowsError() + public function testPositiveBigIntForIntVariableThrowsError() : void { $this->expectGraphQLError(['intInput' => 2147483648]); } - public function testNegativeBigIntForIntVariableThrowsError() + public function testNegativeBigIntForIntVariableThrowsError() : void { $this->expectGraphQLError(['intInput' => -2147483649]); } diff --git a/tests/Executor/VariablesTest.php b/tests/Executor/VariablesTest.php index abf57aa..89392d2 100644 --- a/tests/Executor/VariablesTest.php +++ b/tests/Executor/VariablesTest.php @@ -12,15 +12,14 @@ use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\Type; use PHPUnit\Framework\TestCase; +/** + * Execute: Handles inputs + * Handles objects and nullability + */ class VariablesTest extends TestCase { - // Execute: Handles inputs - // Handles objects and nullability - /** - * @describe using inline structs - */ - public function testUsingInlineStructs() + public function testUsingInlineStructs() : void { // executes with complex input: $result = $this->executeQuery(' @@ -95,10 +94,7 @@ class VariablesTest extends TestCase ); } - /** - * @describe using variables - */ - public function testUsingVariables() + public function testUsingVariables() : void { $doc = ' query q($input:TestInputObject) { @@ -249,7 +245,7 @@ class VariablesTest extends TestCase /** * @see it('allows nullable inputs to be omitted') */ - public function testAllowsNullableInputsToBeOmitted() + public function testAllowsNullableInputsToBeOmitted() : void { $result = $this->executeQuery(' { @@ -266,7 +262,7 @@ class VariablesTest extends TestCase /** * @see it('allows nullable inputs to be omitted in a variable') */ - public function testAllowsNullableInputsToBeOmittedInAVariable() + public function testAllowsNullableInputsToBeOmittedInAVariable() : void { $result = $this->executeQuery(' query SetsNullable($value: String) { @@ -281,7 +277,7 @@ class VariablesTest extends TestCase /** * @see it('allows nullable inputs to be omitted in an unlisted variable') */ - public function testAllowsNullableInputsToBeOmittedInAnUnlistedVariable() + public function testAllowsNullableInputsToBeOmittedInAnUnlistedVariable() : void { $result = $this->executeQuery(' query SetsNullable { @@ -295,7 +291,7 @@ class VariablesTest extends TestCase /** * @see it('allows nullable inputs to be set to null in a variable') */ - public function testAllowsNullableInputsToBeSetToNullInAVariable() + public function testAllowsNullableInputsToBeSetToNullInAVariable() : void { $result = $this->executeQuery(' query SetsNullable($value: String) { @@ -310,7 +306,7 @@ class VariablesTest extends TestCase /** * @see it('allows nullable inputs to be set to a value in a variable') */ - public function testAllowsNullableInputsToBeSetToAValueInAVariable() + public function testAllowsNullableInputsToBeSetToAValueInAVariable() : void { $doc = ' query SetsNullable($value: String) { @@ -325,7 +321,7 @@ class VariablesTest extends TestCase /** * @see it('allows nullable inputs to be set to a value directly') */ - public function testAllowsNullableInputsToBeSetToAValueDirectly() + public function testAllowsNullableInputsToBeSetToAValueDirectly() : void { $result = $this->executeQuery(' { @@ -342,7 +338,7 @@ class VariablesTest extends TestCase /** * @see it('allows non-nullable inputs to be omitted given a default') */ - public function testAllowsNonNullableInputsToBeOmittedGivenADefault() + public function testAllowsNonNullableInputsToBeOmittedGivenADefault() : void { $result = $this->executeQuery(' query SetsNonNullable($value: String = "default") { @@ -358,7 +354,7 @@ class VariablesTest extends TestCase /** * @see it('does not allow non-nullable inputs to be omitted in a variable') */ - public function testDoesntAllowNonNullableInputsToBeOmittedInAVariable() + public function testDoesntAllowNonNullableInputsToBeOmittedInAVariable() : void { $result = $this->executeQuery(' query SetsNonNullable($value: String!) { @@ -381,7 +377,7 @@ class VariablesTest extends TestCase /** * @see it('does not allow non-nullable inputs to be set to null in a variable') */ - public function testDoesNotAllowNonNullableInputsToBeSetToNullInAVariable() + public function testDoesNotAllowNonNullableInputsToBeSetToNullInAVariable() : void { $doc = ' query SetsNonNullable($value: String!) { @@ -406,7 +402,7 @@ class VariablesTest extends TestCase /** * @see it('allows non-nullable inputs to be set to a value in a variable') */ - public function testAllowsNonNullableInputsToBeSetToAValueInAVariable() + public function testAllowsNonNullableInputsToBeSetToAValueInAVariable() : void { $doc = ' query SetsNonNullable($value: String!) { @@ -421,7 +417,7 @@ class VariablesTest extends TestCase /** * @see it('allows non-nullable inputs to be set to a value directly') */ - public function testAllowsNonNullableInputsToBeSetToAValueDirectly() + public function testAllowsNonNullableInputsToBeSetToAValueDirectly() : void { $result = $this->executeQuery(' { @@ -435,7 +431,7 @@ class VariablesTest extends TestCase /** * @see it('reports error for missing non-nullable inputs') */ - public function testReportsErrorForMissingNonNullableInputs() + public function testReportsErrorForMissingNonNullableInputs() : void { $result = $this->executeQuery(' { @@ -457,7 +453,7 @@ class VariablesTest extends TestCase /** * @see it('reports error for array passed into string input') */ - public function testReportsErrorForArrayPassedIntoStringInput() + public function testReportsErrorForArrayPassedIntoStringInput() : void { $doc = ' @@ -485,7 +481,7 @@ class VariablesTest extends TestCase /** * @see it('serializing an array via GraphQLString throws TypeError') */ - public function testSerializingAnArrayViaGraphQLStringThrowsTypeError() + public function testSerializingAnArrayViaGraphQLStringThrowsTypeError() : void { $this->expectException(Error::class); $this->expectExceptionMessage('String cannot represent non scalar value: [1,2,3]'); @@ -495,7 +491,7 @@ class VariablesTest extends TestCase /** * @see it('reports error for non-provided variables for non-nullable inputs') */ - public function testReportsErrorForNonProvidedVariablesForNonNullableInputs() + public function testReportsErrorForNonProvidedVariablesForNonNullableInputs() : void { // Note: this test would typically fail validation before encountering // this execution error, however for queries which previously validated @@ -526,7 +522,7 @@ class VariablesTest extends TestCase /** * @see it('allows lists to be null') */ - public function testAllowsListsToBeNull() + public function testAllowsListsToBeNull() : void { $doc = ' query q($input:[String]) { @@ -542,7 +538,7 @@ class VariablesTest extends TestCase /** * @see it('allows lists to contain values') */ - public function testAllowsListsToContainValues() + public function testAllowsListsToContainValues() : void { $doc = ' query q($input:[String]) { @@ -557,7 +553,7 @@ class VariablesTest extends TestCase /** * @see it('allows lists to contain null') */ - public function testAllowsListsToContainNull() + public function testAllowsListsToContainNull() : void { $doc = ' query q($input:[String]) { @@ -572,7 +568,7 @@ class VariablesTest extends TestCase /** * @see it('does not allow non-null lists to be null') */ - public function testDoesNotAllowNonNullListsToBeNull() + public function testDoesNotAllowNonNullListsToBeNull() : void { $doc = ' query q($input:[String]!) { @@ -597,7 +593,7 @@ class VariablesTest extends TestCase /** * @see it('allows non-null lists to contain values') */ - public function testAllowsNonNullListsToContainValues() + public function testAllowsNonNullListsToContainValues() : void { $doc = ' query q($input:[String]!) { @@ -612,7 +608,7 @@ class VariablesTest extends TestCase /** * @see it('allows non-null lists to contain null') */ - public function testAllowsNonNullListsToContainNull() + public function testAllowsNonNullListsToContainNull() : void { $doc = ' query q($input:[String]!) { @@ -627,7 +623,7 @@ class VariablesTest extends TestCase /** * @see it('allows lists of non-nulls to be null') */ - public function testAllowsListsOfNonNullsToBeNull() + public function testAllowsListsOfNonNullsToBeNull() : void { $doc = ' query q($input:[String!]) { @@ -642,7 +638,7 @@ class VariablesTest extends TestCase /** * @see it('allows lists of non-nulls to contain values') */ - public function testAllowsListsOfNonNullsToContainValues() + public function testAllowsListsOfNonNullsToContainValues() : void { $doc = ' query q($input:[String!]) { @@ -657,7 +653,7 @@ class VariablesTest extends TestCase /** * @see it('does not allow lists of non-nulls to contain null') */ - public function testDoesNotAllowListsOfNonNullsToContainNull() + public function testDoesNotAllowListsOfNonNullsToContainNull() : void { $doc = ' query q($input:[String!]) { @@ -682,7 +678,7 @@ class VariablesTest extends TestCase /** * @see it('does not allow non-null lists of non-nulls to be null') */ - public function testDoesNotAllowNonNullListsOfNonNullsToBeNull() + public function testDoesNotAllowNonNullListsOfNonNullsToBeNull() : void { $doc = ' query q($input:[String!]!) { @@ -707,7 +703,7 @@ class VariablesTest extends TestCase /** * @see it('allows non-null lists of non-nulls to contain values') */ - public function testAllowsNonNullListsOfNonNullsToContainValues() + public function testAllowsNonNullListsOfNonNullsToContainValues() : void { $doc = ' query q($input:[String!]!) { @@ -722,7 +718,7 @@ class VariablesTest extends TestCase /** * @see it('does not allow non-null lists of non-nulls to contain null') */ - public function testDoesNotAllowNonNullListsOfNonNullsToContainNull() + public function testDoesNotAllowNonNullListsOfNonNullsToContainNull() : void { $doc = ' query q($input:[String!]!) { @@ -747,7 +743,7 @@ class VariablesTest extends TestCase /** * @see it('does not allow invalid types to be used as values') */ - public function testDoesNotAllowInvalidTypesToBeUsedAsValues() + public function testDoesNotAllowInvalidTypesToBeUsedAsValues() : void { $doc = ' query q($input: TestType!) { @@ -773,7 +769,7 @@ class VariablesTest extends TestCase /** * @see it('does not allow unknown types to be used as values') */ - public function testDoesNotAllowUnknownTypesToBeUsedAsValues() + public function testDoesNotAllowUnknownTypesToBeUsedAsValues() : void { $doc = ' query q($input: UnknownType!) { @@ -801,7 +797,7 @@ class VariablesTest extends TestCase /** * @see it('when no argument provided') */ - public function testWhenNoArgumentProvided() + public function testWhenNoArgumentProvided() : void { $result = $this->executeQuery('{ fieldWithDefaultArgumentValue @@ -816,7 +812,7 @@ class VariablesTest extends TestCase /** * @see it('when omitted variable provided') */ - public function testWhenOmittedVariableProvided() + public function testWhenOmittedVariableProvided() : void { $result = $this->executeQuery('query optionalVariable($optional: String) { fieldWithDefaultArgumentValue(input: $optional) @@ -831,7 +827,7 @@ class VariablesTest extends TestCase /** * @see it('not when argument cannot be coerced') */ - public function testNotWhenArgumentCannotBeCoerced() + public function testNotWhenArgumentCannotBeCoerced() : void { $result = $this->executeQuery('{ fieldWithDefaultArgumentValue(input: WRONG_TYPE) diff --git a/tests/Language/LexerTest.php b/tests/Language/LexerTest.php index 898f1c6..a109232 100644 --- a/tests/Language/LexerTest.php +++ b/tests/Language/LexerTest.php @@ -14,7 +14,7 @@ class LexerTest extends TestCase /** * @see it('disallows uncommon control characters') */ - public function testDissallowsUncommonControlCharacters() + public function testDissallowsUncommonControlCharacters() : void { $this->expectSyntaxError( Utils::chr(0x0007), @@ -26,7 +26,7 @@ class LexerTest extends TestCase /** * @see it('accepts BOM header') */ - public function testAcceptsBomHeader() + public function testAcceptsBomHeader() : void { $bom = Utils::chr(0xFEFF); $expected = [ @@ -42,7 +42,7 @@ class LexerTest extends TestCase /** * @see it('records line and column') */ - public function testRecordsLineAndColumn() + public function testRecordsLineAndColumn() : void { $expected = [ 'kind' => Token::NAME, @@ -58,7 +58,7 @@ class LexerTest extends TestCase /** * @see it('skips whitespace and comments') */ - public function testSkipsWhitespacesAndComments() + public function testSkipsWhitespacesAndComments() : void { $example1 = ' @@ -101,7 +101,7 @@ class LexerTest extends TestCase /** * @see it('errors respect whitespace') */ - public function testErrorsRespectWhitespace() + public function testErrorsRespectWhitespace() : void { $str = '' . "\n" . @@ -129,7 +129,7 @@ class LexerTest extends TestCase /** * @see it('updates line numbers in error for file context') */ - public function testUpdatesLineNumbersInErrorForFileContext() + public function testUpdatesLineNumbersInErrorForFileContext() : void { $str = '' . "\n" . @@ -156,7 +156,7 @@ class LexerTest extends TestCase } } - public function testUpdatesColumnNumbersInErrorForFileContext() + public function testUpdatesColumnNumbersInErrorForFileContext() : void { $source = new Source('?', 'foo.js', new SourceLocation(1, 5)); @@ -179,7 +179,7 @@ class LexerTest extends TestCase /** * @see it('lexes strings') */ - public function testLexesStrings() + public function testLexesStrings() : void { $this->assertArraySubset([ 'kind' => Token::STRING, @@ -243,7 +243,7 @@ class LexerTest extends TestCase /** * @see it('lexes block strings') */ - public function testLexesBlockString() + public function testLexesBlockString() : void { $this->assertArraySubset([ 'kind' => Token::BLOCK_STRING, @@ -338,7 +338,7 @@ class LexerTest extends TestCase * @dataProvider reportsUsefulStringErrors * @see it('lex reports useful string errors') */ - public function testLexReportsUsefulStringErrors($str, $expectedMessage, $location) + public function testLexReportsUsefulStringErrors($str, $expectedMessage, $location) : void { $this->expectSyntaxError($str, $expectedMessage, $location); } @@ -356,7 +356,7 @@ class LexerTest extends TestCase * @dataProvider reportsUsefulBlockStringErrors * @see it('lex reports useful block string errors') */ - public function testReportsUsefulBlockStringErrors($str, $expectedMessage, $location) + public function testReportsUsefulBlockStringErrors($str, $expectedMessage, $location) : void { $this->expectSyntaxError($str, $expectedMessage, $location); } @@ -364,7 +364,7 @@ class LexerTest extends TestCase /** * @see it('lexes numbers') */ - public function testLexesNumbers() + public function testLexesNumbers() : void { $this->assertArraySubset( ['kind' => Token::INT, 'start' => 0, 'end' => 1, 'value' => '4'], @@ -451,7 +451,7 @@ class LexerTest extends TestCase * @dataProvider reportsUsefulNumberErrors * @see it('lex reports useful number errors') */ - public function testReportsUsefulNumberErrors($str, $expectedMessage, $location) + public function testReportsUsefulNumberErrors($str, $expectedMessage, $location) : void { $this->expectSyntaxError($str, $expectedMessage, $location); } @@ -459,7 +459,7 @@ class LexerTest extends TestCase /** * @see it('lexes punctuation') */ - public function testLexesPunctuation() + public function testLexesPunctuation() : void { $this->assertArraySubset( ['kind' => Token::BANG, 'start' => 0, 'end' => 1, 'value' => null], @@ -532,7 +532,7 @@ class LexerTest extends TestCase * @dataProvider reportsUsefulUnknownCharErrors * @see it('lex reports useful unknown character error') */ - public function testReportsUsefulUnknownCharErrors($str, $expectedMessage, $location) + public function testReportsUsefulUnknownCharErrors($str, $expectedMessage, $location) : void { $this->expectSyntaxError($str, $expectedMessage, $location); } @@ -540,7 +540,7 @@ class LexerTest extends TestCase /** * @see it('lex reports useful information for dashes in names') */ - public function testReportsUsefulDashesInfo() + public function testReportsUsefulDashesInfo() : void { $q = 'a-b'; $lexer = new Lexer(new Source($q)); @@ -560,7 +560,7 @@ class LexerTest extends TestCase /** * @see it('produces double linked list of tokens, including comments') */ - public function testDoubleLinkedList() + public function testDoubleLinkedList() : void { $lexer = new Lexer(new Source('{ #comment diff --git a/tests/Language/ParserTest.php b/tests/Language/ParserTest.php index b62a7eb..c50ecfb 100644 --- a/tests/Language/ParserTest.php +++ b/tests/Language/ParserTest.php @@ -19,21 +19,21 @@ use PHPUnit\Framework\TestCase; class ParserTest extends TestCase { - public function testAssertsThatASourceToParseIsNotNull() + public function testAssertsThatASourceToParseIsNotNull() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage('GraphQL query body is expected to be string, but got NULL'); Parser::parse(null); } - public function testAssertsThatASourceToParseIsNotArray() + public function testAssertsThatASourceToParseIsNotArray() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage('GraphQL query body is expected to be string, but got array'); Parser::parse(['a' => 'b']); } - public function testAssertsThatASourceToParseIsNotObject() + public function testAssertsThatASourceToParseIsNotObject() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage('GraphQL query body is expected to be string, but got stdClass'); @@ -57,7 +57,7 @@ fragment MissingOn Type * @dataProvider parseProvidesUsefulErrors * @see it('parse provides useful errors') */ - public function testParseProvidesUsefulErrors($str, $expectedMessage, $stringRepresentation, $expectedPositions = null, $expectedLocations = null) + public function testParseProvidesUsefulErrors($str, $expectedMessage, $stringRepresentation, $expectedPositions = null, $expectedLocations = null) : void { try { Parser::parse($str); @@ -79,7 +79,7 @@ fragment MissingOn Type /** * @see it('parse provides useful error when using source') */ - public function testParseProvidesUsefulErrorWhenUsingSource() + public function testParseProvidesUsefulErrorWhenUsingSource() : void { try { Parser::parse(new Source('query', 'MyQuery.graphql')); @@ -95,7 +95,7 @@ fragment MissingOn Type /** * @see it('parses variable inline values') */ - public function testParsesVariableInlineValues() + public function testParsesVariableInlineValues() : void { $this->expectNotToPerformAssertions(); // Following line should not throw: @@ -105,7 +105,7 @@ fragment MissingOn Type /** * @see it('parses constant default values') */ - public function testParsesConstantDefaultValues() + public function testParsesConstantDefaultValues() : void { $this->expectSyntaxError( 'query Foo($x: Complex = { a: { b: [ $var ] } }) { field }', @@ -117,7 +117,7 @@ fragment MissingOn Type /** * @see it('does not accept fragments spread of "on"') */ - public function testDoesNotAcceptFragmentsNamedOn() + public function testDoesNotAcceptFragmentsNamedOn() : void { $this->expectSyntaxError( 'fragment on on on { on }', @@ -129,7 +129,7 @@ fragment MissingOn Type /** * @see it('does not accept fragments spread of "on"') */ - public function testDoesNotAcceptFragmentSpreadOfOn() + public function testDoesNotAcceptFragmentSpreadOfOn() : void { $this->expectSyntaxError( '{ ...on }', @@ -141,7 +141,7 @@ fragment MissingOn Type /** * @see it('parses multi-byte characters') */ - public function testParsesMultiByteCharacters() + public function testParsesMultiByteCharacters() : void { // Note: \u0A0A could be naively interpretted as two line-feed chars. @@ -176,7 +176,7 @@ HEREDOC; /** * @see it('parses kitchen sink') */ - public function testParsesKitchenSink() + public function testParsesKitchenSink() : void { // Following should not throw: $kitchenSink = file_get_contents(__DIR__ . '/kitchen-sink.graphql'); @@ -187,7 +187,7 @@ HEREDOC; /** * allows non-keywords anywhere a Name is allowed */ - public function testAllowsNonKeywordsAnywhereANameIsAllowed() + public function testAllowsNonKeywordsAnywhereANameIsAllowed() : void { $nonKeywords = [ 'on', @@ -220,7 +220,7 @@ fragment $fragmentName on Type { /** * @see it('parses anonymous mutation operations') */ - public function testParsessAnonymousMutationOperations() + public function testParsessAnonymousMutationOperations() : void { $this->expectNotToPerformAssertions(); // Should not throw: @@ -234,7 +234,7 @@ fragment $fragmentName on Type { /** * @see it('parses anonymous subscription operations') */ - public function testParsesAnonymousSubscriptionOperations() + public function testParsesAnonymousSubscriptionOperations() : void { $this->expectNotToPerformAssertions(); // Should not throw: @@ -248,7 +248,7 @@ fragment $fragmentName on Type { /** * @see it('parses named mutation operations') */ - public function testParsesNamedMutationOperations() + public function testParsesNamedMutationOperations() : void { $this->expectNotToPerformAssertions(); // Should not throw: @@ -262,7 +262,7 @@ fragment $fragmentName on Type { /** * @see it('parses named subscription operations') */ - public function testParsesNamedSubscriptionOperations() + public function testParsesNamedSubscriptionOperations() : void { $this->expectNotToPerformAssertions(); Parser::parse(' @@ -275,7 +275,7 @@ fragment $fragmentName on Type { /** * @see it('creates ast') */ - public function testParseCreatesAst() + public function testParseCreatesAst() : void { $source = new Source('{ node(id: 4) { @@ -379,7 +379,7 @@ fragment $fragmentName on Type { /** * @see it('creates ast from nameless query without variables') */ - public function testParseCreatesAstFromNamelessQueryWithoutVariables() + public function testParseCreatesAstFromNamelessQueryWithoutVariables() : void { $source = new Source('query { node { @@ -454,7 +454,7 @@ fragment $fragmentName on Type { /** * @see it('allows parsing without source location information') */ - public function testAllowsParsingWithoutSourceLocationInformation() + public function testAllowsParsingWithoutSourceLocationInformation() : void { $source = new Source('{ id }'); $result = Parser::parse($source, ['noLocation' => true]); @@ -465,7 +465,7 @@ fragment $fragmentName on Type { /** * @see it('Experimental: allows parsing fragment defined variables') */ - public function testExperimentalAllowsParsingFragmentDefinedVariables() + public function testExperimentalAllowsParsingFragmentDefinedVariables() : void { $source = new Source('fragment a($v: Boolean = false) on t { f(v: $v) }'); // not throw @@ -478,7 +478,7 @@ fragment $fragmentName on Type { /** * @see it('contains location information that only stringifys start/end') */ - public function testContainsLocationInformationThatOnlyStringifysStartEnd() + public function testContainsLocationInformationThatOnlyStringifysStartEnd() : void { $source = new Source('{ id }'); $result = Parser::parse($source); @@ -488,7 +488,7 @@ fragment $fragmentName on Type { /** * @see it('contains references to source') */ - public function testContainsReferencesToSource() + public function testContainsReferencesToSource() : void { $source = new Source('{ id }'); $result = Parser::parse($source); @@ -498,7 +498,7 @@ fragment $fragmentName on Type { /** * @see it('contains references to start and end tokens') */ - public function testContainsReferencesToStartAndEndTokens() + public function testContainsReferencesToStartAndEndTokens() : void { $source = new Source('{ id }'); $result = Parser::parse($source); @@ -511,7 +511,7 @@ fragment $fragmentName on Type { /** * @see it('parses null value') */ - public function testParsesNullValues() + public function testParsesNullValues() : void { $this->assertEquals([ 'kind' => NodeKind::NULL, @@ -522,7 +522,7 @@ fragment $fragmentName on Type { /** * @see it('parses list values') */ - public function testParsesListValues() + public function testParsesListValues() : void { $this->assertEquals([ 'kind' => NodeKind::LST, @@ -548,7 +548,7 @@ fragment $fragmentName on Type { /** * @see it('parses well known types') */ - public function testParsesWellKnownTypes() + public function testParsesWellKnownTypes() : void { $this->assertEquals([ 'kind' => NodeKind::NAMED_TYPE, @@ -564,7 +564,7 @@ fragment $fragmentName on Type { /** * @see it('parses custom types') */ - public function testParsesCustomTypes() + public function testParsesCustomTypes() : void { $this->assertEquals([ 'kind' => NodeKind::NAMED_TYPE, @@ -580,7 +580,7 @@ fragment $fragmentName on Type { /** * @see it('parses list types') */ - public function testParsesListTypes() + public function testParsesListTypes() : void { $this->assertEquals([ 'kind' => NodeKind::LIST_TYPE, @@ -600,7 +600,7 @@ fragment $fragmentName on Type { /** * @see it('parses non-null types') */ - public function testParsesNonNullTypes() + public function testParsesNonNullTypes() : void { $this->assertEquals([ 'kind' => NodeKind::NON_NULL_TYPE, @@ -620,7 +620,7 @@ fragment $fragmentName on Type { /** * @see it('parses nested types') */ - public function testParsesNestedTypes() + public function testParsesNestedTypes() : void { $this->assertEquals([ 'kind' => NodeKind::LIST_TYPE, diff --git a/tests/Language/PrinterTest.php b/tests/Language/PrinterTest.php index f5d82ef..cba6b11 100644 --- a/tests/Language/PrinterTest.php +++ b/tests/Language/PrinterTest.php @@ -19,7 +19,7 @@ class PrinterTest extends TestCase /** * @see it('does not alter ast') */ - public function testDoesntAlterAST() + public function testDoesntAlterAST() : void { $kitchenSink = file_get_contents(__DIR__ . '/kitchen-sink.graphql'); $ast = Parser::parse($kitchenSink); @@ -34,7 +34,7 @@ class PrinterTest extends TestCase /** * @see it('prints minimal ast') */ - public function testPrintsMinimalAst() + public function testPrintsMinimalAst() : void { $ast = new FieldNode(['name' => new NameNode(['value' => 'foo'])]); $this->assertEquals('foo', Printer::doPrint($ast)); @@ -43,7 +43,7 @@ class PrinterTest extends TestCase /** * @see it('produces helpful error messages') */ - public function testProducesHelpfulErrorMessages() + public function testProducesHelpfulErrorMessages() : void { $badAst1 = new \ArrayObject(['random' => 'Data']); $this->expectException(\Throwable::class); @@ -54,7 +54,7 @@ class PrinterTest extends TestCase /** * @see it('correctly prints non-query operations without name') */ - public function testCorrectlyPrintsOpsWithoutName() + public function testCorrectlyPrintsOpsWithoutName() : void { $queryAstShorthanded = Parser::parse('query { id, name }'); @@ -97,7 +97,7 @@ class PrinterTest extends TestCase /** * @see it('correctly prints single-line with leading space') */ - public function testCorrectlyPrintsSingleLineBlockStringsWithLeadingSpace() + public function testCorrectlyPrintsSingleLineBlockStringsWithLeadingSpace() : void { $mutationAstWithArtifacts = Parser::parse( '{ field(arg: """ space-led value""") }' @@ -112,7 +112,7 @@ class PrinterTest extends TestCase /** * @see it('correctly prints string with a first line indentation') */ - public function testCorrectlyPrintsBlockStringsWithAFirstLineIndentation() + public function testCorrectlyPrintsBlockStringsWithAFirstLineIndentation() : void { $mutationAstWithArtifacts = Parser::parse( '{ @@ -137,7 +137,7 @@ class PrinterTest extends TestCase /** * @see it('correctly prints single-line with leading space and quotation') */ - public function testCorrectlyPrintsSingleLineWithLeadingSpaceAndQuotation() + public function testCorrectlyPrintsSingleLineWithLeadingSpaceAndQuotation() : void { $mutationAstWithArtifacts = Parser::parse(' { @@ -158,7 +158,7 @@ END; /** * @see it('Experimental: correctly prints fragment defined variables') */ - public function testExperimentalCorrectlyPrintsFragmentDefinedVariables() + public function testExperimentalCorrectlyPrintsFragmentDefinedVariables() : void { $fragmentWithVariable = Parser::parse(' fragment Foo($a: ComplexType, $b: Boolean = false) on TestType { @@ -180,7 +180,7 @@ END; /** * @see it('correctly prints single-line with leading space and quotation') */ - public function testCorrectlyPrintsSingleLineStringsWithLeadingSpaceAndQuotation() + public function testCorrectlyPrintsSingleLineStringsWithLeadingSpaceAndQuotation() : void { $mutationAstWithArtifacts = Parser::parse( '{ @@ -199,7 +199,7 @@ END; /** * @see it('prints kitchen sink') */ - public function testPrintsKitchenSink() + public function testPrintsKitchenSink() : void { $kitchenSink = file_get_contents(__DIR__ . '/kitchen-sink.graphql'); $ast = Parser::parse($kitchenSink); diff --git a/tests/Language/SchemaParserTest.php b/tests/Language/SchemaParserTest.php index b44ce5c..465cf27 100644 --- a/tests/Language/SchemaParserTest.php +++ b/tests/Language/SchemaParserTest.php @@ -14,7 +14,7 @@ class SchemaParserTest extends TestCase /** * @see it('Simple type') */ - public function testSimpleType() + public function testSimpleType() : void { $body = ' type Hello { @@ -50,7 +50,7 @@ type Hello { /** * @see it('parses type with description string') */ - public function testParsesTypeWithDescriptionString() + public function testParsesTypeWithDescriptionString() : void { $body = ' "Description" @@ -92,7 +92,7 @@ type Hello { /** * @see it('parses type with description multi-linestring') */ - public function testParsesTypeWithDescriptionMultiLineString() + public function testParsesTypeWithDescriptionMultiLineString() : void { $body = ' """ @@ -137,7 +137,7 @@ type Hello { /** * @see it('Simple extension') */ - public function testSimpleExtension() + public function testSimpleExtension() : void { $body = ' extend type Hello { @@ -174,7 +174,7 @@ extend type Hello { /** * @see it('Extension without fields') */ - public function testExtensionWithoutFields() + public function testExtensionWithoutFields() : void { $body = 'extend type Hello implements Greeting'; $doc = Parser::parse($body); @@ -203,7 +203,7 @@ extend type Hello { /** * @see it('Extension without fields followed by extension') */ - public function testExtensionWithoutFieldsFollowedByExtension() + public function testExtensionWithoutFieldsFollowedByExtension() : void { $body = ' extend type Hello implements Greeting @@ -239,7 +239,7 @@ extend type Hello { /** * @see it('Extension without anything throws') */ - public function testExtensionWithoutAnythingThrows() + public function testExtensionWithoutAnythingThrows() : void { $this->expectSyntaxError( 'extend type Hello', @@ -251,7 +251,7 @@ extend type Hello { /** * @see it('Extension do not include descriptions') */ - public function testExtensionDoNotIncludeDescriptions() + public function testExtensionDoNotIncludeDescriptions() : void { $body = ' "Description" @@ -268,7 +268,7 @@ extend type Hello { /** * @see it('Extension do not include descriptions') */ - public function testExtensionDoNotIncludeDescriptions2() + public function testExtensionDoNotIncludeDescriptions2() : void { $body = ' extend "Description" type Hello { @@ -285,7 +285,7 @@ extend type Hello { /** * @see it('Simple non-null type') */ - public function testSimpleNonNullType() + public function testSimpleNonNullType() : void { $body = ' type Hello { @@ -328,7 +328,7 @@ type Hello { /** * @see it('Simple type inheriting interface') */ - public function testSimpleTypeInheritingInterface() + public function testSimpleTypeInheritingInterface() : void { $body = 'type Hello implements World { field: String }'; $loc = function($start, $end) { return TestUtils::locArray($start, $end); }; @@ -364,7 +364,7 @@ type Hello { /** * @see it('Simple type inheriting multiple interfaces') */ - public function testSimpleTypeInheritingMultipleInterfaces() + public function testSimpleTypeInheritingMultipleInterfaces() : void { $body = 'type Hello implements Wo & rld { field: String }'; $loc = function($start, $end) {return TestUtils::locArray($start, $end);}; @@ -401,7 +401,7 @@ type Hello { /** * @see it('Simple type inheriting multiple interfaces with leading ampersand') */ - public function testSimpleTypeInheritingMultipleInterfacesWithLeadingAmpersand() + public function testSimpleTypeInheritingMultipleInterfacesWithLeadingAmpersand() : void { $body = 'type Hello implements & Wo & rld { field: String }'; $loc = function($start, $end) {return TestUtils::locArray($start, $end);}; @@ -436,7 +436,7 @@ type Hello { /** * @see it('Single value enum') */ - public function testSingleValueEnum() + public function testSingleValueEnum() : void { $body = 'enum Hello { WORLD }'; $loc = function($start, $end) {return TestUtils::locArray($start, $end);}; @@ -463,7 +463,7 @@ type Hello { /** * @see it('Double value enum') */ - public function testDoubleValueEnum() + public function testDoubleValueEnum() : void { $body = 'enum Hello { WO, RLD }'; $loc = function($start, $end) {return TestUtils::locArray($start, $end);}; @@ -493,7 +493,7 @@ type Hello { /** * @see it('Simple interface') */ - public function testSimpleInterface() + public function testSimpleInterface() : void { $body = ' interface Hello { @@ -528,7 +528,7 @@ interface Hello { /** * @see it('Simple field with arg') */ - public function testSimpleFieldWithArg() + public function testSimpleFieldWithArg() : void { $body = ' type Hello { @@ -573,7 +573,7 @@ type Hello { /** * @see it('Simple field with arg with default value') */ - public function testSimpleFieldWithArgWithDefaultValue() + public function testSimpleFieldWithArgWithDefaultValue() : void { $body = ' type Hello { @@ -617,7 +617,7 @@ type Hello { /** * @see it('Simple field with list arg') */ - public function testSimpleFieldWithListArg() + public function testSimpleFieldWithListArg() : void { $body = ' type Hello { @@ -662,7 +662,7 @@ type Hello { /** * @see it('Simple field with two args') */ - public function testSimpleFieldWithTwoArgs() + public function testSimpleFieldWithTwoArgs() : void { $body = ' type Hello { @@ -713,7 +713,7 @@ type Hello { /** * @see it('Simple union') */ - public function testSimpleUnion() + public function testSimpleUnion() : void { $body = 'union Hello = World'; $doc = Parser::parse($body); @@ -739,7 +739,7 @@ type Hello { /** * @see it('Union with two types') */ - public function testUnionWithTwoTypes() + public function testUnionWithTwoTypes() : void { $body = 'union Hello = Wo | Rld'; $doc = Parser::parse($body); @@ -769,7 +769,7 @@ type Hello { /** * @see it('Union with two types and leading pipe') */ - public function testUnionWithTwoTypesAndLeadingPipe() + public function testUnionWithTwoTypesAndLeadingPipe() : void { $body = 'union Hello = | Wo | Rld'; $doc = Parser::parse($body); @@ -796,7 +796,7 @@ type Hello { /** * @see it('Union fails with no types') */ - public function testUnionFailsWithNoTypes() + public function testUnionFailsWithNoTypes() : void { $this->expectSyntaxError( 'union Hello = |', @@ -808,7 +808,7 @@ type Hello { /** * @see it('Union fails with leading douple pipe') */ - public function testUnionFailsWithLeadingDoublePipe() + public function testUnionFailsWithLeadingDoublePipe() : void { $this->expectSyntaxError( 'union Hello = || Wo | Rld', @@ -820,7 +820,7 @@ type Hello { /** * @see it('Union fails with double pipe') */ - public function testUnionFailsWithDoublePipe() + public function testUnionFailsWithDoublePipe() : void { $this->expectSyntaxError( 'union Hello = Wo || Rld', @@ -832,7 +832,7 @@ type Hello { /** * @see it('Union fails with trailing pipe') */ - public function testUnionFailsWithTrailingPipe() + public function testUnionFailsWithTrailingPipe() : void { $this->expectSyntaxError( 'union Hello = | Wo | Rld |', @@ -844,7 +844,7 @@ type Hello { /** * @see it('Scalar') */ - public function testScalar() + public function testScalar() : void { $body = 'scalar Hello'; $doc = Parser::parse($body); @@ -868,7 +868,7 @@ type Hello { /** * @see it('Simple input object') */ - public function testSimpleInputObject() + public function testSimpleInputObject() : void { $body = ' input Hello { @@ -904,7 +904,7 @@ input Hello { /** * @see it('Simple input object with args should fail') */ - public function testSimpleInputObjectWithArgsShouldFail() + public function testSimpleInputObjectWithArgsShouldFail() : void { $body = ' input Hello { @@ -920,7 +920,7 @@ input Hello { /** * @see it('Directive with incorrect locations') */ - public function testDirectiveWithIncorrectLocationShouldFail() + public function testDirectiveWithIncorrectLocationShouldFail() : void { $body = ' directive @foo on FIELD | INCORRECT_LOCATION @@ -932,7 +932,7 @@ input Hello { ); } - public function testDoesNotAllowEmptyFields() + public function testDoesNotAllowEmptyFields() : void { $body = 'type Hello { }'; $this->expectSyntaxError($body, 'Syntax Error: Expected Name, found }', new SourceLocation(1, 14)); @@ -941,7 +941,7 @@ input Hello { /** * @see it('Option: allowLegacySDLEmptyFields supports type with empty fields') */ - public function testAllowLegacySDLEmptyFieldsOption() + public function testAllowLegacySDLEmptyFieldsOption() : void { $body = 'type Hello { }'; $doc = Parser::parse($body, ['allowLegacySDLEmptyFields' => true]); @@ -955,7 +955,7 @@ input Hello { $this->assertArraySubset($expected, $doc->toArray(true)); } - public function testDoesntAllowLegacySDLImplementsInterfacesByDefault() + public function testDoesntAllowLegacySDLImplementsInterfacesByDefault() : void { $body = 'type Hello implements Wo rld { field: String }'; $this->expectSyntaxError($body, 'Syntax Error: Unexpected Name "rld"', new SourceLocation(1, 26)); @@ -964,7 +964,7 @@ input Hello { /** * @see it('Option: allowLegacySDLImplementsInterfaces') */ - public function testDefaultSDLImplementsInterfaces() + public function testDefaultSDLImplementsInterfaces() : void { $body = 'type Hello implements Wo rld { field: String }'; $doc = Parser::parse($body, ['allowLegacySDLImplementsInterfaces' => true]); diff --git a/tests/Language/SchemaPrinterTest.php b/tests/Language/SchemaPrinterTest.php index 8b30087..b0cc05f 100644 --- a/tests/Language/SchemaPrinterTest.php +++ b/tests/Language/SchemaPrinterTest.php @@ -13,7 +13,7 @@ class SchemaPrinterTest extends TestCase /** * @see it('prints minimal ast') */ - public function testPrintsMinimalAst() + public function testPrintsMinimalAst() : void { $ast = new ScalarTypeDefinitionNode([ 'name' => new NameNode(['value' => 'foo']) @@ -24,7 +24,7 @@ class SchemaPrinterTest extends TestCase /** * @see it('produces helpful error messages') */ - public function testProducesHelpfulErrorMessages() + public function testProducesHelpfulErrorMessages() : void { $this->expectException(Throwable::class); $this->expectExceptionMessage('Invalid AST Node: {"random":"Data"}'); @@ -37,7 +37,7 @@ class SchemaPrinterTest extends TestCase /** * @see it('does not alter ast') */ - public function testDoesNotAlterAst() + public function testDoesNotAlterAst() : void { $kitchenSink = file_get_contents(__DIR__ . '/schema-kitchen-sink.graphql'); @@ -48,7 +48,7 @@ class SchemaPrinterTest extends TestCase $this->assertEquals($astCopy, $ast); } - public function testPrintsKitchenSink() + public function testPrintsKitchenSink() : void { $kitchenSink = file_get_contents(__DIR__ . '/schema-kitchen-sink.graphql'); diff --git a/tests/Language/SerializationTest.php b/tests/Language/SerializationTest.php index f2fe16c..7624fdc 100644 --- a/tests/Language/SerializationTest.php +++ b/tests/Language/SerializationTest.php @@ -10,7 +10,7 @@ use PHPUnit\Framework\TestCase; class SerializationTest extends TestCase { - public function testSerializesAst() + public function testSerializesAst() : void { $kitchenSink = file_get_contents(__DIR__ . '/kitchen-sink.graphql'); $ast = Parser::parse($kitchenSink); @@ -18,7 +18,7 @@ class SerializationTest extends TestCase $this->assertEquals($expectedAst, $ast->toArray(true)); } - public function testUnserializesAst() + public function testUnserializesAst() : void { $kitchenSink = file_get_contents(__DIR__ . '/kitchen-sink.graphql'); $serializedAst = json_decode(file_get_contents(__DIR__ . '/kitchen-sink.ast'), true); @@ -27,7 +27,7 @@ class SerializationTest extends TestCase $this->assertNodesAreEqual($parsedAst, $actualAst); } - public function testSerializeSupportsNoLocationOption() + public function testSerializeSupportsNoLocationOption() : void { $kitchenSink = file_get_contents(__DIR__ . '/kitchen-sink.graphql'); $ast = Parser::parse($kitchenSink, ['noLocation' => true]); @@ -35,7 +35,7 @@ class SerializationTest extends TestCase $this->assertEquals($expectedAst, $ast->toArray(true)); } - public function testUnserializeSupportsNoLocationOption() + public function testUnserializeSupportsNoLocationOption() : void { $kitchenSink = file_get_contents(__DIR__ . '/kitchen-sink.graphql'); $serializedAst = json_decode(file_get_contents(__DIR__ . '/kitchen-sink-noloc.ast'), true); diff --git a/tests/Language/TokenTest.php b/tests/Language/TokenTest.php index 541a618..ea21d20 100644 --- a/tests/Language/TokenTest.php +++ b/tests/Language/TokenTest.php @@ -6,7 +6,7 @@ use PHPUnit\Framework\TestCase; class TokenTest extends TestCase { - public function testReturnTokenOnArray() + public function testReturnTokenOnArray() : void { $token = new Token('Kind', 1, 10, 3, 5); $expected = [ diff --git a/tests/Language/VisitorTest.php b/tests/Language/VisitorTest.php index fd7bb20..300dea8 100644 --- a/tests/Language/VisitorTest.php +++ b/tests/Language/VisitorTest.php @@ -84,7 +84,7 @@ class VisitorTest extends ValidatorTestCase } } - public function testValidatesPathArgument() + public function testValidatesPathArgument() : void { $visited = []; @@ -117,7 +117,7 @@ class VisitorTest extends ValidatorTestCase $this->assertEquals($expected, $visited); } - public function testAllowsEditingNodeOnEnterAndOnLeave() + public function testAllowsEditingNodeOnEnterAndOnLeave() : void { $ast = Parser::parse('{ a, b, c { a, b, c } }', [ 'noLocation' => true ]); @@ -154,7 +154,7 @@ class VisitorTest extends ValidatorTestCase $this->assertEquals($expected, $editedAst); } - public function testAllowsEditingRootNodeOnEnterAndLeave() + public function testAllowsEditingRootNodeOnEnterAndLeave() : void { $ast = Parser::parse('{ a, b, c { a, b, c } }', [ 'noLocation' => true ]); $definitions = $ast->definitions; @@ -185,7 +185,7 @@ class VisitorTest extends ValidatorTestCase $this->assertEquals($tmp, $editedAst); } - public function testAllowsForEditingOnEnter() + public function testAllowsForEditingOnEnter() : void { $ast = Parser::parse('{ a, b, c { a, b, c } }', ['noLocation' => true]); $editedAst = Visitor::visit($ast, [ @@ -207,7 +207,7 @@ class VisitorTest extends ValidatorTestCase ); } - public function testAllowsForEditingOnLeave() + public function testAllowsForEditingOnLeave() : void { $ast = Parser::parse('{ a, b, c { a, b, c } }', ['noLocation' => true]); $editedAst = Visitor::visit($ast, [ @@ -230,7 +230,7 @@ class VisitorTest extends ValidatorTestCase ); } - public function testVisitsEditedNode() + public function testVisitsEditedNode() : void { $addedField = new FieldNode([ 'name' => new NameNode(['value' => '__typename']), @@ -261,7 +261,7 @@ class VisitorTest extends ValidatorTestCase $this->assertTrue($didVisitAddedField); } - public function testAllowsSkippingASubTree() + public function testAllowsSkippingASubTree() : void { $visited = []; $ast = Parser::parse('{ a, b { x }, c }', ['noLocation' => true]); @@ -301,7 +301,7 @@ class VisitorTest extends ValidatorTestCase $this->assertEquals($expected, $visited); } - public function testAllowsEarlyExitWhileVisiting() + public function testAllowsEarlyExitWhileVisiting() : void { $visited = []; $ast = Parser::parse('{ a, b { x }, c }', ['noLocation' => true]); @@ -339,7 +339,7 @@ class VisitorTest extends ValidatorTestCase $this->assertEquals($expected, $visited); } - public function testAllowsEarlyExitWhileLeaving() + public function testAllowsEarlyExitWhileLeaving() : void { $visited = []; @@ -377,7 +377,7 @@ class VisitorTest extends ValidatorTestCase ]); } - public function testAllowsANamedFunctionsVisitorAPI() + public function testAllowsANamedFunctionsVisitorAPI() : void { $visited = []; $ast = Parser::parse('{ a, b { x }, c }', ['noLocation' => true]); @@ -413,7 +413,7 @@ class VisitorTest extends ValidatorTestCase $this->assertEquals($expected, $visited); } - public function testExperimentalVisitsVariablesDefinedInFragments() + public function testExperimentalVisitsVariablesDefinedInFragments() : void { $ast = Parser::parse( 'fragment a($v: Boolean = false) on t { f }', @@ -469,7 +469,7 @@ class VisitorTest extends ValidatorTestCase $this->assertEquals($expected, $visited); } - public function testVisitsKitchenSink() + public function testVisitsKitchenSink() : void { $kitchenSink = file_get_contents(__DIR__ . '/kitchen-sink.graphql'); $ast = Parser::parse($kitchenSink); @@ -808,7 +808,7 @@ class VisitorTest extends ValidatorTestCase * Describe: visitInParallel * Note: nearly identical to the above test of the same test but using visitInParallel. */ - public function testAllowsSkippingSubTree() + public function testAllowsSkippingSubTree() : void { $visited = []; @@ -850,7 +850,7 @@ class VisitorTest extends ValidatorTestCase ], $visited); } - public function testAllowsSkippingDifferentSubTrees() + public function testAllowsSkippingDifferentSubTrees() : void { $visited = []; @@ -922,7 +922,7 @@ class VisitorTest extends ValidatorTestCase ], $visited); } - public function testAllowsEarlyExitWhileVisiting2() + public function testAllowsEarlyExitWhileVisiting2() : void { $visited = []; @@ -960,7 +960,7 @@ class VisitorTest extends ValidatorTestCase ], $visited); } - public function testAllowsEarlyExitFromDifferentPoints() + public function testAllowsEarlyExitFromDifferentPoints() : void { $visited = []; @@ -1020,7 +1020,7 @@ class VisitorTest extends ValidatorTestCase ], $visited); } - public function testAllowsEarlyExitWhileLeaving2() + public function testAllowsEarlyExitWhileLeaving2() : void { $visited = []; @@ -1059,7 +1059,7 @@ class VisitorTest extends ValidatorTestCase ], $visited); } - public function testAllowsEarlyExitFromLeavingDifferentPoints() + public function testAllowsEarlyExitFromLeavingDifferentPoints() : void { $visited = []; @@ -1133,7 +1133,7 @@ class VisitorTest extends ValidatorTestCase ], $visited); } - public function testAllowsForEditingOnEnter2() + public function testAllowsForEditingOnEnter2() : void { $visited = []; @@ -1197,7 +1197,7 @@ class VisitorTest extends ValidatorTestCase ], $visited); } - public function testAllowsForEditingOnLeave2() + public function testAllowsForEditingOnLeave2() : void { $visited = []; @@ -1271,7 +1271,7 @@ class VisitorTest extends ValidatorTestCase /** * Describe: visitWithTypeInfo */ - public function testMaintainsTypeInfoDuringVisit() + public function testMaintainsTypeInfoDuringVisit() : void { $visited = []; @@ -1353,7 +1353,7 @@ class VisitorTest extends ValidatorTestCase ], $visited); } - public function testMaintainsTypeInfoDuringEdit() + public function testMaintainsTypeInfoDuringEdit() : void { $visited = []; $typeInfo = new TypeInfo(ValidatorTestCase::getTestSchema()); diff --git a/tests/Server/PsrResponseTest.php b/tests/Server/PsrResponseTest.php index 9988d55..b3ff6ec 100644 --- a/tests/Server/PsrResponseTest.php +++ b/tests/Server/PsrResponseTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class PsrResponseTest extends TestCase { - public function testConvertsResultToPsrResponse() + public function testConvertsResultToPsrResponse() : void { $result = new ExecutionResult(['key' => 'value']); $stream = new PsrStreamStub(); diff --git a/tests/Server/QueryExecutionTest.php b/tests/Server/QueryExecutionTest.php index 1381eda..0b7d473 100644 --- a/tests/Server/QueryExecutionTest.php +++ b/tests/Server/QueryExecutionTest.php @@ -31,7 +31,7 @@ class QueryExecutionTest extends ServerTestCase ->setSchema($schema); } - public function testSimpleQueryExecution() + public function testSimpleQueryExecution() : void { $query = '{f1}'; @@ -44,7 +44,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertQueryResultEquals($expected, $query); } - public function testReturnsSyntaxErrors() + public function testReturnsSyntaxErrors() : void { $query = '{f1'; @@ -57,7 +57,7 @@ class QueryExecutionTest extends ServerTestCase ); } - public function testDebugExceptions() + public function testDebugExceptions() : void { $debug = Debug::INCLUDE_DEBUG_MESSAGE | Debug::INCLUDE_TRACE; $this->config->setDebug($debug); @@ -87,7 +87,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertArraySubset($expected, $result); } - public function testPassesRootValueAndContext() + public function testPassesRootValueAndContext() : void { $rootValue = 'myRootValue'; $context = new \stdClass(); @@ -107,7 +107,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertSame($rootValue, $context->testedRootValue); } - public function testPassesVariables() + public function testPassesVariables() : void { $variables = ['a' => 'a', 'b' => 'b']; $query = ' @@ -125,7 +125,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertQueryResultEquals($expected, $query, $variables); } - public function testPassesCustomValidationRules() + public function testPassesCustomValidationRules() : void { $query = ' {nonExistentField} @@ -155,7 +155,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertTrue($called); } - public function testAllowsValidationRulesAsClosure() + public function testAllowsValidationRulesAsClosure() : void { $called = false; $params = $doc = $operationType = null; @@ -176,7 +176,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertEquals('query', $operationType); } - public function testAllowsDifferentValidationRulesDependingOnOperation() + public function testAllowsDifferentValidationRulesDependingOnOperation() : void { $q1 = '{f1}'; $q2 = '{invalid}'; @@ -210,7 +210,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertTrue($called2); } - public function testAllowsSkippingValidation() + public function testAllowsSkippingValidation() : void { $this->config->setValidationRules([]); $query = '{nonExistentField}'; @@ -218,7 +218,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertQueryResultEquals($expected, $query); } - public function testPersistedQueriesAreDisabledByDefault() + public function testPersistedQueriesAreDisabledByDefault() : void { $result = $this->executePersistedQuery('some-id'); @@ -233,7 +233,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertEquals($expected, $result->toArray()); } - public function testBatchedQueriesAreDisabledByDefault() + public function testBatchedQueriesAreDisabledByDefault() : void { $batch = [ [ @@ -269,7 +269,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertEquals($expected[1], $result[1]->toArray()); } - public function testMutationsAreNotAllowedInReadonlyMode() + public function testMutationsAreNotAllowedInReadonlyMode() : void { $mutation = 'mutation { a }'; @@ -286,7 +286,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertEquals($expected, $result->toArray()); } - public function testAllowsPersistentQueries() + public function testAllowsPersistentQueries() : void { $called = false; $this->config->setPersistentQueryLoader(function($queryId, OperationParams $params) use (&$called) { @@ -317,7 +317,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertEquals($expected, $result->toArray()); } - public function testProhibitsInvalidPersistedQueryLoader() + public function testProhibitsInvalidPersistedQueryLoader() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -330,7 +330,7 @@ class QueryExecutionTest extends ServerTestCase $this->executePersistedQuery('some-id'); } - public function testPersistedQueriesAreStillValidatedByDefault() + public function testPersistedQueriesAreStillValidatedByDefault() : void { $this->config->setPersistentQueryLoader(function() { return '{invalid}'; @@ -349,7 +349,7 @@ class QueryExecutionTest extends ServerTestCase } - public function testAllowSkippingValidationForPersistedQueries() + public function testAllowSkippingValidationForPersistedQueries() : void { $this->config ->setPersistentQueryLoader(function($queryId) { @@ -386,7 +386,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertEquals($expected, $result->toArray()); } - public function testProhibitsUnexpectedValidationRules() + public function testProhibitsUnexpectedValidationRules() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage('Expecting validation rules to be array or callable returning array, but got: instance of stdClass'); @@ -396,7 +396,7 @@ class QueryExecutionTest extends ServerTestCase $this->executeQuery('{f1}'); } - public function testExecutesBatchedQueries() + public function testExecutesBatchedQueries() : void { $this->config->setQueryBatching(true); @@ -446,7 +446,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertArraySubset($expected[2], $result[2]->toArray()); } - public function testDeferredsAreSharedAmongAllBatchedQueries() + public function testDeferredsAreSharedAmongAllBatchedQueries() : void { $batch = [ [ @@ -510,7 +510,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertEquals($expected[2], $result[2]->toArray()); } - public function testValidatesParamsBeforeExecution() + public function testValidatesParamsBeforeExecution() : void { $op = OperationParams::create(['queryBad' => '{f1}']); $helper = new Helper(); @@ -531,7 +531,7 @@ class QueryExecutionTest extends ServerTestCase ); } - public function testAllowsContextAsClosure() + public function testAllowsContextAsClosure() : void { $called = false; $params = $doc = $operationType = null; @@ -551,7 +551,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertEquals('query', $operationType); } - public function testAllowsRootValueAsClosure() + public function testAllowsRootValueAsClosure() : void { $called = false; $params = $doc = $operationType = null; @@ -571,7 +571,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertEquals('query', $operationType); } - public function testAppliesErrorFormatter() + public function testAppliesErrorFormatter() : void { $called = false; $error = null; @@ -606,7 +606,7 @@ class QueryExecutionTest extends ServerTestCase $this->assertArraySubset($expected, $formatted); } - public function testAppliesErrorsHandler() + public function testAppliesErrorsHandler() : void { $called = false; $errors = null; diff --git a/tests/Server/RequestParsingTest.php b/tests/Server/RequestParsingTest.php index aca363d..47d715c 100644 --- a/tests/Server/RequestParsingTest.php +++ b/tests/Server/RequestParsingTest.php @@ -12,7 +12,7 @@ use PHPUnit\Framework\TestCase; class RequestParsingTest extends TestCase { - public function testParsesGraphqlRequest() + public function testParsesGraphqlRequest() : void { $query = '{my query}'; $parsed = [ @@ -26,7 +26,7 @@ class RequestParsingTest extends TestCase } } - public function testParsesUrlencodedRequest() + public function testParsesUrlencodedRequest() : void { $query = '{my query}'; $variables = ['test' => 1, 'test2' => 2]; @@ -48,7 +48,7 @@ class RequestParsingTest extends TestCase } } - public function testParsesGetRequest() + public function testParsesGetRequest() : void { $query = '{my query}'; $variables = ['test' => 1, 'test2' => 2]; @@ -70,7 +70,7 @@ class RequestParsingTest extends TestCase } } - public function testParsesMultipartFormdataRequest() + public function testParsesMultipartFormdataRequest() : void { $query = '{my query}'; $variables = ['test' => 1, 'test2' => 2]; @@ -92,7 +92,7 @@ class RequestParsingTest extends TestCase } } - public function testParsesJSONRequest() + public function testParsesJSONRequest() : void { $query = '{my query}'; $variables = ['test' => 1, 'test2' => 2]; @@ -113,7 +113,7 @@ class RequestParsingTest extends TestCase } } - public function testParsesVariablesAsJSON() + public function testParsesVariablesAsJSON() : void { $query = '{my query}'; $variables = ['test' => 1, 'test2' => 2]; @@ -134,7 +134,7 @@ class RequestParsingTest extends TestCase } } - public function testIgnoresInvalidVariablesJson() + public function testIgnoresInvalidVariablesJson() : void { $query = '{my query}'; $variables = '"some invalid json'; @@ -155,7 +155,7 @@ class RequestParsingTest extends TestCase } } - public function testParsesBatchJSONRequest() + public function testParsesBatchJSONRequest() : void { $body = [ [ @@ -181,7 +181,7 @@ class RequestParsingTest extends TestCase } } - public function testFailsParsingInvalidRawJsonRequestRaw() + public function testFailsParsingInvalidRawJsonRequestRaw() : void { $body = 'not really{} a json'; @@ -190,7 +190,7 @@ class RequestParsingTest extends TestCase $this->parseRawRequest('application/json', $body); } - public function testFailsParsingInvalidRawJsonRequestPsr() + public function testFailsParsingInvalidRawJsonRequestPsr() : void { $body = 'not really{} a json'; @@ -199,7 +199,7 @@ class RequestParsingTest extends TestCase $this->parsePsrRequest('application/json', $body); } - public function testFailsParsingNonPreParsedPsrRequest() + public function testFailsParsingNonPreParsedPsrRequest() : void { try { $this->parsePsrRequest('application/json', json_encode(null)); @@ -213,9 +213,10 @@ class RequestParsingTest extends TestCase } } - // There is no equivalent for psr request, because it should throw - - public function testFailsParsingNonArrayOrObjectJsonRequestRaw() + /** + * There is no equivalent for psr request, because it should throw + */ + public function testFailsParsingNonArrayOrObjectJsonRequestRaw() : void { $body = '"str"'; @@ -224,7 +225,7 @@ class RequestParsingTest extends TestCase $this->parseRawRequest('application/json', $body); } - public function testFailsParsingNonArrayOrObjectJsonRequestPsr() + public function testFailsParsingNonArrayOrObjectJsonRequestPsr() : void { $body = '"str"'; @@ -233,7 +234,7 @@ class RequestParsingTest extends TestCase $this->parsePsrRequest('application/json', $body); } - public function testFailsParsingInvalidContentTypeRaw() + public function testFailsParsingInvalidContentTypeRaw() : void { $contentType = 'not-supported-content-type'; $body = 'test'; @@ -243,7 +244,7 @@ class RequestParsingTest extends TestCase $this->parseRawRequest($contentType, $body); } - public function testFailsParsingInvalidContentTypePsr() + public function testFailsParsingInvalidContentTypePsr() : void { $contentType = 'not-supported-content-type'; $body = 'test'; @@ -253,28 +254,28 @@ class RequestParsingTest extends TestCase $this->parseRawRequest($contentType, $body); } - public function testFailsWithMissingContentTypeRaw() + public function testFailsWithMissingContentTypeRaw() : void { $this->expectException(RequestError::class); $this->expectExceptionMessage('Missing "Content-Type" header'); $this->parseRawRequest(null, 'test'); } - public function testFailsWithMissingContentTypePsr() + public function testFailsWithMissingContentTypePsr() : void { $this->expectException(RequestError::class); $this->expectExceptionMessage('Missing "Content-Type" header'); $this->parsePsrRequest(null, 'test'); } - public function testFailsOnMethodsOtherThanPostOrGetRaw() + public function testFailsOnMethodsOtherThanPostOrGetRaw() : void { $this->expectException(RequestError::class); $this->expectExceptionMessage('HTTP Method "PUT" is not supported'); $this->parseRawRequest('application/json', json_encode([]), "PUT"); } - public function testFailsOnMethodsOtherThanPostOrGetPsr() + public function testFailsOnMethodsOtherThanPostOrGetPsr() : void { $this->expectException(RequestError::class); $this->expectExceptionMessage('HTTP Method "PUT" is not supported'); diff --git a/tests/Server/RequestValidationTest.php b/tests/Server/RequestValidationTest.php index bff1e5e..e205bfd 100644 --- a/tests/Server/RequestValidationTest.php +++ b/tests/Server/RequestValidationTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; class RequestValidationTest extends TestCase { - public function testSimpleRequestShouldValidate() + public function testSimpleRequestShouldValidate() : void { $query = '{my q}'; $variables = ['a' => 'b', 'c' => 'd']; @@ -22,7 +22,7 @@ class RequestValidationTest extends TestCase $this->assertValid($parsedBody); } - public function testRequestWithQueryIdShouldValidate() + public function testRequestWithQueryIdShouldValidate() : void { $queryId = 'some-query-id'; $variables = ['a' => 'b', 'c' => 'd']; @@ -37,7 +37,7 @@ class RequestValidationTest extends TestCase $this->assertValid($parsedBody); } - public function testRequiresQueryOrQueryId() + public function testRequiresQueryOrQueryId() : void { $parsedBody = OperationParams::create([ 'variables' => ['foo' => 'bar'], @@ -50,7 +50,7 @@ class RequestValidationTest extends TestCase ); } - public function testFailsWhenBothQueryAndQueryIdArePresent() + public function testFailsWhenBothQueryAndQueryIdArePresent() : void { $parsedBody = OperationParams::create([ 'query' => '{my query}', @@ -63,7 +63,7 @@ class RequestValidationTest extends TestCase ); } - public function testFailsWhenQueryParameterIsNotString() + public function testFailsWhenQueryParameterIsNotString() : void { $parsedBody = OperationParams::create([ 'query' => ['t' => '{my query}'] @@ -75,7 +75,7 @@ class RequestValidationTest extends TestCase ); } - public function testFailsWhenQueryIdParameterIsNotString() + public function testFailsWhenQueryIdParameterIsNotString() : void { $parsedBody = OperationParams::create([ 'queryId' => ['t' => '{my query}'] @@ -87,7 +87,7 @@ class RequestValidationTest extends TestCase ); } - public function testFailsWhenOperationParameterIsNotString() + public function testFailsWhenOperationParameterIsNotString() : void { $parsedBody = OperationParams::create([ 'query' => '{my query}', @@ -103,7 +103,7 @@ class RequestValidationTest extends TestCase /** * @see https://github.com/webonyx/graphql-php/issues/156 */ - public function testIgnoresNullAndEmptyStringVariables() + public function testIgnoresNullAndEmptyStringVariables() : void { $query = '{my q}'; $parsedBody = OperationParams::create([ @@ -120,7 +120,7 @@ class RequestValidationTest extends TestCase $this->assertValid($parsedBody); } - public function testFailsWhenVariablesParameterIsNotObject() + public function testFailsWhenVariablesParameterIsNotObject() : void { $parsedBody = OperationParams::create([ 'query' => '{my query}', diff --git a/tests/Server/ServerConfigTest.php b/tests/Server/ServerConfigTest.php index 8e78f8f..d8af920 100644 --- a/tests/Server/ServerConfigTest.php +++ b/tests/Server/ServerConfigTest.php @@ -11,7 +11,7 @@ use PHPUnit\Framework\TestCase; class ServerConfigTest extends TestCase { - public function testDefaults() + public function testDefaults() : void { $config = ServerConfig::create(); $this->assertEquals(null, $config->getSchema()); @@ -27,7 +27,7 @@ class ServerConfigTest extends TestCase $this->assertEquals(false, $config->getQueryBatching()); } - public function testAllowsSettingSchema() + public function testAllowsSettingSchema() : void { $schema = new Schema(['query' => new ObjectType(['name' => 'a', 'fields' => []])]); $config = ServerConfig::create() @@ -40,7 +40,7 @@ class ServerConfigTest extends TestCase $this->assertSame($schema2, $config->getSchema()); } - public function testAllowsSettingContext() + public function testAllowsSettingContext() : void { $config = ServerConfig::create(); @@ -53,7 +53,7 @@ class ServerConfigTest extends TestCase $this->assertSame($context2, $config->getContext()); } - public function testAllowsSettingRootValue() + public function testAllowsSettingRootValue() : void { $config = ServerConfig::create(); @@ -66,7 +66,7 @@ class ServerConfigTest extends TestCase $this->assertSame($context2, $config->getRootValue()); } - public function testAllowsSettingErrorFormatter() + public function testAllowsSettingErrorFormatter() : void { $config = ServerConfig::create(); @@ -79,7 +79,7 @@ class ServerConfigTest extends TestCase $this->assertSame($formatter, $config->getErrorFormatter()); } - public function testAllowsSettingErrorsHandler() + public function testAllowsSettingErrorsHandler() : void { $config = ServerConfig::create(); @@ -92,7 +92,7 @@ class ServerConfigTest extends TestCase $this->assertSame($handler, $config->getErrorsHandler()); } - public function testAllowsSettingPromiseAdapter() + public function testAllowsSettingPromiseAdapter() : void { $config = ServerConfig::create(); @@ -105,7 +105,7 @@ class ServerConfigTest extends TestCase $this->assertSame($adapter2, $config->getPromiseAdapter()); } - public function testAllowsSettingValidationRules() + public function testAllowsSettingValidationRules() : void { $config = ServerConfig::create(); @@ -122,7 +122,7 @@ class ServerConfigTest extends TestCase $this->assertSame($rules, $config->getValidationRules()); } - public function testAllowsSettingDefaultFieldResolver() + public function testAllowsSettingDefaultFieldResolver() : void { $config = ServerConfig::create(); @@ -135,7 +135,7 @@ class ServerConfigTest extends TestCase $this->assertSame($resolver, $config->getFieldResolver()); } - public function testAllowsSettingPersistedQueryLoader() + public function testAllowsSettingPersistedQueryLoader() : void { $config = ServerConfig::create(); @@ -148,7 +148,7 @@ class ServerConfigTest extends TestCase $this->assertSame($loader, $config->getPersistentQueryLoader()); } - public function testAllowsSettingCatchPhpErrors() + public function testAllowsSettingCatchPhpErrors() : void { $config = ServerConfig::create(); @@ -159,7 +159,7 @@ class ServerConfigTest extends TestCase $this->assertSame(false, $config->getDebug()); } - public function testAcceptsArray() + public function testAcceptsArray() : void { $arr = [ 'schema' => new \GraphQL\Type\Schema([ @@ -190,7 +190,7 @@ class ServerConfigTest extends TestCase $this->assertSame(true, $config->getQueryBatching()); } - public function testThrowsOnInvalidArrayKey() + public function testThrowsOnInvalidArrayKey() : void { $arr = [ 'missingKey' => 'value' @@ -202,7 +202,7 @@ class ServerConfigTest extends TestCase ServerConfig::create($arr); } - public function testInvalidValidationRules() + public function testInvalidValidationRules() : void { $rules = new \stdClass(); $config = ServerConfig::create(); diff --git a/tests/Server/StandardServerTest.php b/tests/Server/StandardServerTest.php index 3f9398b..5c22788 100644 --- a/tests/Server/StandardServerTest.php +++ b/tests/Server/StandardServerTest.php @@ -22,7 +22,7 @@ class StandardServerTest extends ServerTestCase ->setSchema($schema); } - public function testSimpleRequestExecutionWithOutsideParsing() + public function testSimpleRequestExecutionWithOutsideParsing() : void { $body = json_encode([ 'query' => '{f1}' @@ -41,7 +41,7 @@ class StandardServerTest extends ServerTestCase $this->assertEquals($expected, $result->toArray(true)); } - public function testSimplePsrRequestExecution() + public function testSimplePsrRequestExecution() : void { $body = [ 'query' => '{f1}' @@ -57,7 +57,7 @@ class StandardServerTest extends ServerTestCase $this->assertPsrRequestEquals($expected, $request); } - public function testMultipleOperationPsrRequestExecution() + public function testMultipleOperationPsrRequestExecution() : void { $body = [ 'query' => 'query firstOp {fieldWithPhpError} query secondOp {f1}', diff --git a/tests/StarWarsIntrospectionTest.php b/tests/StarWarsIntrospectionTest.php index 3d961fa..07c605e 100644 --- a/tests/StarWarsIntrospectionTest.php +++ b/tests/StarWarsIntrospectionTest.php @@ -12,7 +12,7 @@ class StarWarsIntrospectionTest extends TestCase /** * @see it('Allows querying the schema for types') */ - public function testAllowsQueryingTheSchemaForTypes() + public function testAllowsQueryingTheSchemaForTypes() : void { $query = ' query IntrospectionTypeQuery { @@ -53,7 +53,7 @@ class StarWarsIntrospectionTest extends TestCase /** * @see it('Allows querying the schema for query type') */ - public function testAllowsQueryingTheSchemaForQueryType() + public function testAllowsQueryingTheSchemaForQueryType() : void { $query = ' query IntrospectionQueryTypeQuery { @@ -77,7 +77,7 @@ class StarWarsIntrospectionTest extends TestCase /** * @see it('Allows querying the schema for a specific type') */ - public function testAllowsQueryingTheSchemaForASpecificType() + public function testAllowsQueryingTheSchemaForASpecificType() : void { $query = ' query IntrospectionDroidTypeQuery { @@ -97,7 +97,7 @@ class StarWarsIntrospectionTest extends TestCase /** * @see it('Allows querying the schema for an object kind') */ - public function testAllowsQueryingForAnObjectKind() + public function testAllowsQueryingForAnObjectKind() : void { $query = ' query IntrospectionDroidKindQuery { @@ -119,7 +119,7 @@ class StarWarsIntrospectionTest extends TestCase /** * @see it('Allows querying the schema for an interface kind') */ - public function testAllowsQueryingForInterfaceKind() + public function testAllowsQueryingForInterfaceKind() : void { $query = ' query IntrospectionCharacterKindQuery { @@ -141,7 +141,7 @@ class StarWarsIntrospectionTest extends TestCase /** * @see it('Allows querying the schema for object fields') */ - public function testAllowsQueryingForObjectFields() + public function testAllowsQueryingForObjectFields() : void { $query = ' query IntrospectionDroidFieldsQuery { @@ -212,7 +212,7 @@ class StarWarsIntrospectionTest extends TestCase /** * @see it('Allows querying the schema for nested object fields') */ - public function testAllowsQueryingTheSchemaForNestedObjectFields() + public function testAllowsQueryingTheSchemaForNestedObjectFields() : void { $query = ' query IntrospectionDroidNestedFieldsQuery { @@ -302,7 +302,7 @@ class StarWarsIntrospectionTest extends TestCase /** * @see it('Allows querying the schema for field args') */ - public function testAllowsQueryingTheSchemaForFieldArgs() + public function testAllowsQueryingTheSchemaForFieldArgs() : void { $query = ' query IntrospectionQueryTypeQuery { @@ -396,7 +396,7 @@ class StarWarsIntrospectionTest extends TestCase /** * @see it('Allows querying the schema for documentation') */ - public function testAllowsQueryingTheSchemaForDocumentation() + public function testAllowsQueryingTheSchemaForDocumentation() : void { $query = ' query IntrospectionDroidDescriptionQuery { diff --git a/tests/StarWarsQueryTest.php b/tests/StarWarsQueryTest.php index c4396b2..aa478dd 100644 --- a/tests/StarWarsQueryTest.php +++ b/tests/StarWarsQueryTest.php @@ -13,7 +13,7 @@ class StarWarsQueryTest extends TestCase /** * @see it('Correctly identifies R2-D2 as the hero of the Star Wars Saga') */ - public function testCorrectlyIdentifiesR2D2AsTheHeroOfTheStarWarsSaga() + public function testCorrectlyIdentifiesR2D2AsTheHeroOfTheStarWarsSaga() : void { $query = ' query HeroNameQuery { @@ -33,7 +33,7 @@ class StarWarsQueryTest extends TestCase /** * @see it('Allows us to query for the ID and friends of R2-D2') */ - public function testAllowsUsToQueryForTheIDAndFriendsOfR2D2() + public function testAllowsUsToQueryForTheIDAndFriendsOfR2D2() : void { $query = ' query HeroNameAndFriendsQuery { @@ -71,7 +71,7 @@ class StarWarsQueryTest extends TestCase /** * @see it('Allows us to query for the friends of friends of R2-D2') */ - public function testAllowsUsToQueryForTheFriendsOfFriendsOfR2D2() + public function testAllowsUsToQueryForTheFriendsOfFriendsOfR2D2() : void { $query = ' query NestedQuery { @@ -132,7 +132,7 @@ class StarWarsQueryTest extends TestCase /** * @see it('Using IDs and query parameters to refetch objects') */ - public function testAllowsUsToQueryForLukeSkywalkerDirectlyUsingHisID() + public function testAllowsUsToQueryForLukeSkywalkerDirectlyUsingHisID() : void { $query = ' query FetchLukeQuery { @@ -153,7 +153,7 @@ class StarWarsQueryTest extends TestCase /** * @see it('Allows us to create a generic query, then use it to fetch Luke Skywalker using his ID') */ - public function testGenericQueryToGetLukeSkywalkerById() + public function testGenericQueryToGetLukeSkywalkerById() : void { $query = ' query FetchSomeIDQuery($someId: String!) { @@ -177,7 +177,7 @@ class StarWarsQueryTest extends TestCase /** * @see it('Allows us to create a generic query, then use it to fetch Han Solo using his ID') */ - public function testGenericQueryToGetHanSoloById() + public function testGenericQueryToGetHanSoloById() : void { $query = ' query FetchSomeIDQuery($someId: String!) { @@ -200,7 +200,7 @@ class StarWarsQueryTest extends TestCase /** * @see it('Allows us to create a generic query, then pass an invalid ID to get null back') */ - public function testGenericQueryWithInvalidId() + public function testGenericQueryWithInvalidId() : void { $query = ' query humanQuery($id: String!) { @@ -335,7 +335,7 @@ class StarWarsQueryTest extends TestCase /** * @see it('Using __typename to find the type of an object') */ - public function testVerifyThatR2D2IsADroid() + public function testVerifyThatR2D2IsADroid() : void { $query = ' query CheckTypeOfR2 { @@ -357,7 +357,7 @@ class StarWarsQueryTest extends TestCase /** * @see it('Allows us to verify that Luke is a human') */ - public function testVerifyThatLukeIsHuman() + public function testVerifyThatLukeIsHuman() : void { $query = ' query CheckTypeOfLuke { diff --git a/tests/StarWarsValidationTest.php b/tests/StarWarsValidationTest.php index d66caa9..a4b0018 100644 --- a/tests/StarWarsValidationTest.php +++ b/tests/StarWarsValidationTest.php @@ -13,7 +13,7 @@ class StarWarsValidationTest extends TestCase /** * @see it('Validates a complex but valid query') */ - public function testValidatesAComplexButValidQuery() + public function testValidatesAComplexButValidQuery() : void { $query = ' query NestedQueryWithFragment { @@ -40,7 +40,7 @@ class StarWarsValidationTest extends TestCase /** * @see it('Notes that non-existent fields are invalid') */ - public function testThatNonExistentFieldsAreInvalid() + public function testThatNonExistentFieldsAreInvalid() : void { $query = ' query HeroSpaceshipQuery { @@ -56,7 +56,7 @@ class StarWarsValidationTest extends TestCase /** * @see it('Requires fields on objects') */ - public function testRequiresFieldsOnObjects() + public function testRequiresFieldsOnObjects() : void { $query = ' query HeroNoFieldsQuery { @@ -71,7 +71,7 @@ class StarWarsValidationTest extends TestCase /** * @see it('Disallows fields on scalars') */ - public function testDisallowsFieldsOnScalars() + public function testDisallowsFieldsOnScalars() : void { $query = ' query HeroFieldsOnScalarQuery { @@ -89,7 +89,7 @@ class StarWarsValidationTest extends TestCase /** * @see it('Disallows object fields on interfaces') */ - public function testDisallowsObjectFieldsOnInterfaces() + public function testDisallowsObjectFieldsOnInterfaces() : void { $query = ' query DroidFieldOnCharacter { @@ -106,7 +106,7 @@ class StarWarsValidationTest extends TestCase /** * @see it('Allows object fields in fragments') */ - public function testAllowsObjectFieldsInFragments() + public function testAllowsObjectFieldsInFragments() : void { $query = ' query DroidFieldInFragment { @@ -127,7 +127,7 @@ class StarWarsValidationTest extends TestCase /** * @see it('Allows object fields in inline fragments') */ - public function testAllowsObjectFieldsInInlineFragments() + public function testAllowsObjectFieldsInInlineFragments() : void { $query = ' query DroidFieldInFragment { diff --git a/tests/Type/DefinitionTest.php b/tests/Type/DefinitionTest.php index 8bd5cf1..d5b6b50 100644 --- a/tests/Type/DefinitionTest.php +++ b/tests/Type/DefinitionTest.php @@ -172,7 +172,7 @@ class DefinitionTest extends TestCase /** * @see it('defines a query only schema') */ - public function testDefinesAQueryOnlySchema() + public function testDefinesAQueryOnlySchema() : void { $blogSchema = new Schema([ 'query' => $this->blogQuery @@ -216,7 +216,7 @@ class DefinitionTest extends TestCase /** * @see it('defines a mutation schema') */ - public function testDefinesAMutationSchema() + public function testDefinesAMutationSchema() : void { $schema = new Schema([ 'query' => $this->blogQuery, @@ -235,7 +235,7 @@ class DefinitionTest extends TestCase /** * @see it('defines a subscription schema') */ - public function testDefinesSubscriptionSchema() + public function testDefinesSubscriptionSchema() : void { $schema = new Schema([ 'query' => $this->blogQuery, @@ -253,7 +253,7 @@ class DefinitionTest extends TestCase /** * @see it('defines an enum type with deprecated value') */ - public function testDefinesEnumTypeWithDeprecatedValue() + public function testDefinesEnumTypeWithDeprecatedValue() : void { $enumTypeWithDeprecatedValue = new EnumType([ 'name' => 'EnumWithDeprecatedValue', @@ -278,7 +278,7 @@ class DefinitionTest extends TestCase /** * @see it('defines an enum type with a value of `null` and `undefined`') */ - public function testDefinesAnEnumTypeWithAValueOfNullAndUndefined() + public function testDefinesAnEnumTypeWithAValueOfNullAndUndefined() : void { $EnumTypeWithNullishValue = new EnumType([ 'name' => 'EnumWithNullishValue', @@ -315,7 +315,7 @@ class DefinitionTest extends TestCase /** * @see it('defines an object type with deprecated field') */ - public function testDefinesAnObjectTypeWithDeprecatedField() + public function testDefinesAnObjectTypeWithDeprecatedField() : void { $TypeWithDeprecatedField = new ObjectType([ 'name' => 'foo', @@ -339,7 +339,7 @@ class DefinitionTest extends TestCase /** * @see it('includes nested input objects in the map') */ - public function testIncludesNestedInputObjectInTheMap() + public function testIncludesNestedInputObjectInTheMap() : void { $nestedInputObject = new InputObjectType([ 'name' => 'NestedInputObject', @@ -369,7 +369,7 @@ class DefinitionTest extends TestCase /** * @see it('includes interface possible types in the type map') */ - public function testIncludesInterfaceSubtypesInTheTypeMap() + public function testIncludesInterfaceSubtypesInTheTypeMap() : void { $someInterface = new InterfaceType([ 'name' => 'SomeInterface', @@ -401,7 +401,7 @@ class DefinitionTest extends TestCase /** * @see it('includes interfaces' thunk subtypes in the type map') */ - public function testIncludesInterfacesThunkSubtypesInTheTypeMap() + public function testIncludesInterfacesThunkSubtypesInTheTypeMap() : void { $someInterface = null; @@ -436,7 +436,7 @@ class DefinitionTest extends TestCase /** * @see it('stringifies simple types') */ - public function testStringifiesSimpleTypes() + public function testStringifiesSimpleTypes() : void { $this->assertSame('Int', (string) Type::int()); $this->assertSame('Article', (string) $this->blogArticle); @@ -457,7 +457,7 @@ class DefinitionTest extends TestCase /** * @see it('JSON stringifies simple types') */ - public function testJSONStringifiesSimpleTypes() + public function testJSONStringifiesSimpleTypes() : void { $this->assertEquals('"Int"', json_encode(Type::int())); $this->assertEquals('"Article"', json_encode($this->blogArticle)); @@ -475,7 +475,7 @@ class DefinitionTest extends TestCase /** * @see it('identifies input types') */ - public function testIdentifiesInputTypes() + public function testIdentifiesInputTypes() : void { $expected = [ [Type::int(), true], @@ -494,7 +494,7 @@ class DefinitionTest extends TestCase /** * @see it('identifies output types') */ - public function testIdentifiesOutputTypes() + public function testIdentifiesOutputTypes() : void { $expected = [ [Type::int(), true], @@ -513,7 +513,7 @@ class DefinitionTest extends TestCase /** * @see it('prohibits nesting NonNull inside NonNull') */ - public function testProhibitsNestingNonNullInsideNonNull() + public function testProhibitsNestingNonNullInsideNonNull() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -525,7 +525,7 @@ class DefinitionTest extends TestCase /** * @see it('allows a thunk for Union member types') */ - public function testAllowsThunkForUnionTypes() + public function testAllowsThunkForUnionTypes() : void { $union = new UnionType([ 'name' => 'ThunkUnion', @@ -537,7 +537,7 @@ class DefinitionTest extends TestCase $this->assertSame($this->objectType, $types[0]); } - public function testAllowsRecursiveDefinitions() + public function testAllowsRecursiveDefinitions() : void { // See https://github.com/webonyx/graphql-php/issues/16 $node = new InterfaceType([ @@ -602,7 +602,7 @@ class DefinitionTest extends TestCase $this->assertSame($user, $blog->getField('owner')->getType()->getWrappedType(true)); } - public function testInputObjectTypeAllowsRecursiveDefinitions() + public function testInputObjectTypeAllowsRecursiveDefinitions() : void { $called = false; $inputObject = new InputObjectType([ @@ -637,7 +637,7 @@ class DefinitionTest extends TestCase $this->assertSame($someMutation->getField('mutateSomething')->getArg('input')->getType(), $inputObject); } - public function testInterfaceTypeAllowsRecursiveDefinitions() + public function testInterfaceTypeAllowsRecursiveDefinitions() : void { $called = false; $interface = new InterfaceType([ @@ -669,7 +669,7 @@ class DefinitionTest extends TestCase $this->assertSame($interface->getField('value')->getType(), Type::string()); } - public function testAllowsShorthandFieldDefinition() + public function testAllowsShorthandFieldDefinition() : void { $interface = new InterfaceType([ 'name' => 'SomeInterface', @@ -715,7 +715,7 @@ class DefinitionTest extends TestCase $this->assertEquals('test', $testField->name); } - public function testInfersNameFromClassname() + public function testInfersNameFromClassname() : void { $myObj = new MyCustomType(); $this->assertEquals('MyCustom', $myObj->name); @@ -724,7 +724,7 @@ class DefinitionTest extends TestCase $this->assertEquals('OtherCustom', $otherCustom->name); } - public function testAllowsOverridingInternalTypes() + public function testAllowsOverridingInternalTypes() : void { $idType = new CustomScalarType([ 'name' => 'ID', @@ -746,7 +746,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts an Object type with a field function') */ - public function testAcceptsAnObjectTypeWithAFieldFunction() + public function testAcceptsAnObjectTypeWithAFieldFunction() : void { $objType = new ObjectType([ 'name' => 'SomeObject', @@ -763,7 +763,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Object type field with undefined config') */ - public function testRejectsAnObjectTypeFieldWithUndefinedConfig() + public function testRejectsAnObjectTypeFieldWithUndefinedConfig() : void { $objType = new ObjectType([ 'name' => 'SomeObject', @@ -781,7 +781,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Object type with incorrectly typed fields') */ - public function testRejectsAnObjectTypeWithIncorrectlyTypedFields() + public function testRejectsAnObjectTypeWithIncorrectlyTypedFields() : void { $objType = new ObjectType([ 'name' => 'SomeObject', @@ -798,7 +798,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Object type with a field function that returns incorrect type') */ - public function testRejectsAnObjectTypeWithAFieldFunctionThatReturnsIncorrectType() + public function testRejectsAnObjectTypeWithAFieldFunctionThatReturnsIncorrectType() : void { $objType = new ObjectType([ 'name' => 'SomeObject', @@ -819,7 +819,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts an Object type with field args') */ - public function testAcceptsAnObjectTypeWithFieldArgs() + public function testAcceptsAnObjectTypeWithFieldArgs() : void { $this->expectNotToPerformAssertions(); $objType = new ObjectType([ @@ -842,7 +842,7 @@ class DefinitionTest extends TestCase /** * @see it('does not allow isDeprecated without deprecationReason on field') */ - public function testDoesNotAllowIsDeprecatedWithoutDeprecationReasonOnField() + public function testDoesNotAllowIsDeprecatedWithoutDeprecationReasonOnField() : void { $OldObject = new ObjectType([ 'name' => 'OldObject', @@ -866,7 +866,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts an Object type with array interfaces') */ - public function testAcceptsAnObjectTypeWithArrayInterfaces() + public function testAcceptsAnObjectTypeWithArrayInterfaces() : void { $objType = new ObjectType([ 'name' => 'SomeObject', @@ -879,7 +879,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts an Object type with interfaces as a function returning an array') */ - public function testAcceptsAnObjectTypeWithInterfacesAsAFunctionReturningAnArray() + public function testAcceptsAnObjectTypeWithInterfacesAsAFunctionReturningAnArray() : void { $objType = new ObjectType([ 'name' => 'SomeObject', @@ -894,7 +894,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Object type with incorrectly typed interfaces') */ - public function testRejectsAnObjectTypeWithIncorrectlyTypedInterfaces() + public function testRejectsAnObjectTypeWithIncorrectlyTypedInterfaces() : void { $objType = new ObjectType([ 'name' => 'SomeObject', @@ -911,7 +911,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Object type with interfaces as a function returning an incorrect type') */ - public function testRejectsAnObjectTypeWithInterfacesAsAFunctionReturningAnIncorrectType() + public function testRejectsAnObjectTypeWithInterfacesAsAFunctionReturningAnIncorrectType() : void { $objType = new ObjectType([ 'name' => 'SomeObject', @@ -956,7 +956,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts a lambda as an Object field resolver') */ - public function testAcceptsALambdaAsAnObjectFieldResolver() + public function testAcceptsALambdaAsAnObjectFieldResolver() : void { $this->expectNotToPerformAssertions(); // should not throw: @@ -966,7 +966,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an empty Object field resolver') */ - public function testRejectsAnEmptyObjectFieldResolver() + public function testRejectsAnEmptyObjectFieldResolver() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -978,7 +978,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects a constant scalar value resolver') */ - public function testRejectsAConstantScalarValueResolver() + public function testRejectsAConstantScalarValueResolver() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -1005,7 +1005,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts an Interface type defining resolveType') */ - public function testAcceptsAnInterfaceTypeDefiningResolveType() + public function testAcceptsAnInterfaceTypeDefiningResolveType() : void { $this->expectNotToPerformAssertions(); $AnotherInterfaceType = new InterfaceType([ @@ -1026,7 +1026,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts an Interface with implementing type defining isTypeOf') */ - public function testAcceptsAnInterfaceWithImplementingTypeDefiningIsTypeOf() + public function testAcceptsAnInterfaceWithImplementingTypeDefiningIsTypeOf() : void { $this->expectNotToPerformAssertions(); $InterfaceTypeWithoutResolveType = new InterfaceType([ @@ -1047,7 +1047,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts an Interface type defining resolveType with implementing type defining isTypeOf') */ - public function testAcceptsAnInterfaceTypeDefiningResolveTypeWithImplementingTypeDefiningIsTypeOf() + public function testAcceptsAnInterfaceTypeDefiningResolveTypeWithImplementingTypeDefiningIsTypeOf() : void { $this->expectNotToPerformAssertions(); $AnotherInterfaceType = new InterfaceType([ @@ -1068,7 +1068,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Interface type with an incorrect type for resolveType') */ - public function testRejectsAnInterfaceTypeWithAnIncorrectTypeForResolveType() + public function testRejectsAnInterfaceTypeWithAnIncorrectTypeForResolveType() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -1096,7 +1096,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts a Union type defining resolveType') */ - public function testAcceptsAUnionTypeDefiningResolveType() + public function testAcceptsAUnionTypeDefiningResolveType() : void { $this->expectNotToPerformAssertions(); // Should not throw: @@ -1111,7 +1111,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts a Union of Object types defining isTypeOf') */ - public function testAcceptsAUnionOfObjectTypesDefiningIsTypeOf() + public function testAcceptsAUnionOfObjectTypesDefiningIsTypeOf() : void { $this->expectNotToPerformAssertions(); // Should not throw: @@ -1126,7 +1126,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts a Union type defining resolveType of Object types defining isTypeOf') */ - public function testAcceptsAUnionTypeDefiningResolveTypeOfObjectTypesDefiningIsTypeOf() + public function testAcceptsAUnionTypeDefiningResolveTypeOfObjectTypesDefiningIsTypeOf() : void { $this->expectNotToPerformAssertions(); // Should not throw: @@ -1141,7 +1141,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Union type with an incorrect type for resolveType') */ - public function testRejectsAnUnionTypeWithAnIncorrectTypeForResolveType() + public function testRejectsAnUnionTypeWithAnIncorrectTypeForResolveType() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -1161,7 +1161,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts a Scalar type defining serialize') */ - public function testAcceptsAScalarTypeDefiningSerialize() + public function testAcceptsAScalarTypeDefiningSerialize() : void { $this->expectNotToPerformAssertions(); // Should not throw @@ -1178,7 +1178,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects a Scalar type not defining serialize') */ - public function testRejectsAScalarTypeNotDefiningSerialize() + public function testRejectsAScalarTypeNotDefiningSerialize() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -1196,7 +1196,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects a Scalar type defining serialize with an incorrect type') */ - public function testRejectsAScalarTypeDefiningSerializeWithAnIncorrectType() + public function testRejectsAScalarTypeDefiningSerializeWithAnIncorrectType() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -1215,7 +1215,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts a Scalar type defining parseValue and parseLiteral') */ - public function testAcceptsAScalarTypeDefiningParseValueAndParseLiteral() + public function testAcceptsAScalarTypeDefiningParseValueAndParseLiteral() : void { $this->expectNotToPerformAssertions(); // Should not throw: @@ -1235,7 +1235,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects a Scalar type defining parseValue but not parseLiteral') */ - public function testRejectsAScalarTypeDefiningParseValueButNotParseLiteral() + public function testRejectsAScalarTypeDefiningParseValueButNotParseLiteral() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -1255,7 +1255,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects a Scalar type defining parseLiteral but not parseValue') */ - public function testRejectsAScalarTypeDefiningParseLiteralButNotParseValue() + public function testRejectsAScalarTypeDefiningParseLiteralButNotParseValue() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -1275,7 +1275,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects a Scalar type defining parseValue and parseLiteral with an incorrect type') */ - public function testRejectsAScalarTypeDefiningParseValueAndParseLiteralWithAnIncorrectType() + public function testRejectsAScalarTypeDefiningParseValueAndParseLiteralWithAnIncorrectType() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -1297,7 +1297,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts an Object type with an isTypeOf function') */ - public function testAcceptsAnObjectTypeWithAnIsTypeOfFunction() + public function testAcceptsAnObjectTypeWithAnIsTypeOfFunction() : void { $this->expectNotToPerformAssertions(); // Should not throw @@ -1312,7 +1312,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Object type with an incorrect type for isTypeOf') */ - public function testRejectsAnObjectTypeWithAnIncorrectTypeForIsTypeOf() + public function testRejectsAnObjectTypeWithAnIncorrectTypeForIsTypeOf() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -1332,7 +1332,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts a Union type with array types') */ - public function testAcceptsAUnionTypeWithArrayTypes() + public function testAcceptsAUnionTypeWithArrayTypes() : void { $this->expectNotToPerformAssertions(); // Should not throw: @@ -1347,7 +1347,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts a Union type with function returning an array of types') */ - public function testAcceptsAUnionTypeWithFunctionReturningAnArrayOfTypes() + public function testAcceptsAUnionTypeWithFunctionReturningAnArrayOfTypes() : void { $this->expectNotToPerformAssertions(); $this->schemaWithFieldType( @@ -1363,7 +1363,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects a Union type without types') */ - public function testRejectsAUnionTypeWithoutTypes() + public function testRejectsAUnionTypeWithoutTypes() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -1379,7 +1379,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects a Union type with incorrectly typed types') */ - public function testRejectsAUnionTypeWithIncorrectlyTypedTypes() + public function testRejectsAUnionTypeWithIncorrectlyTypedTypes() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage( @@ -1398,7 +1398,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts an Input Object type with fields') */ - public function testAcceptsAnInputObjectTypeWithFields() + public function testAcceptsAnInputObjectTypeWithFields() : void { $inputObjType = new InputObjectType([ 'name' => 'SomeInputObject', @@ -1413,7 +1413,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts an Input Object type with a field function') */ - public function testAcceptsAnInputObjectTypeWithAFieldFunction() + public function testAcceptsAnInputObjectTypeWithAFieldFunction() : void { $inputObjType = new InputObjectType([ 'name' => 'SomeInputObject', @@ -1430,7 +1430,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Input Object type with incorrect fields') */ - public function testRejectsAnInputObjectTypeWithIncorrectFields() + public function testRejectsAnInputObjectTypeWithIncorrectFields() : void { $inputObjType = new InputObjectType([ 'name' => 'SomeInputObject', @@ -1447,7 +1447,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Input Object type with fields function that returns incorrect type') */ - public function testRejectsAnInputObjectTypeWithFieldsFunctionThatReturnsIncorrectType() + public function testRejectsAnInputObjectTypeWithFieldsFunctionThatReturnsIncorrectType() : void { $inputObjType = new InputObjectType([ 'name' => 'SomeInputObject', @@ -1468,7 +1468,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Input Object type with resolvers') */ - public function testRejectsAnInputObjectTypeWithResolvers() + public function testRejectsAnInputObjectTypeWithResolvers() : void { $inputObjType = new InputObjectType([ 'name' => 'SomeInputObject', @@ -1492,7 +1492,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Input Object type with resolver constant') */ - public function testRejectsAnInputObjectTypeWithResolverConstant() + public function testRejectsAnInputObjectTypeWithResolverConstant() : void { $inputObjType = new InputObjectType([ 'name' => 'SomeInputObject', @@ -1516,7 +1516,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts a well defined Enum type with empty value definition') */ - public function testAcceptsAWellDefinedEnumTypeWithEmptyValueDefinition() + public function testAcceptsAWellDefinedEnumTypeWithEmptyValueDefinition() : void { $enumType = new EnumType([ 'name' => 'SomeEnum', @@ -1532,7 +1532,7 @@ class DefinitionTest extends TestCase /** * @see it('accepts a well defined Enum type with internal value definition') */ - public function testAcceptsAWellDefinedEnumTypeWithInternalValueDefinition() + public function testAcceptsAWellDefinedEnumTypeWithInternalValueDefinition() : void { $enumType = new EnumType([ 'name' => 'SomeEnum', @@ -1548,7 +1548,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects an Enum type with incorrectly typed values') */ - public function testRejectsAnEnumTypeWithIncorrectlyTypedValues() + public function testRejectsAnEnumTypeWithIncorrectlyTypedValues() : void { $enumType = new EnumType([ 'name' => 'SomeEnum', @@ -1564,7 +1564,7 @@ class DefinitionTest extends TestCase /** * @see it('does not allow isDeprecated without deprecationReason on enum') */ - public function testDoesNotAllowIsDeprecatedWithoutDeprecationReasonOnEnum() + public function testDoesNotAllowIsDeprecatedWithoutDeprecationReasonOnEnum() : void { $enumType = new EnumType([ 'name' => 'SomeEnum', @@ -1582,9 +1582,11 @@ class DefinitionTest extends TestCase $enumType->assertValid(); } - // Type System: List must accept only types - public function testListMustAcceptOnlyTypes() + /** + * Type System: List must accept only types + */ + public function testListMustAcceptOnlyTypes() : void { $types = [ Type::string(), @@ -1618,9 +1620,11 @@ class DefinitionTest extends TestCase } } - // Type System: NonNull must only accept non-nullable types - public function testNonNullMustOnlyAcceptNonNullableTypes() + /** + * Type System: NonNull must only accept non-nullable types + */ + public function testNonNullMustOnlyAcceptNonNullableTypes() : void { $nullableTypes = [ Type::string(), @@ -1663,7 +1667,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects a Schema which redefines a built-in type') */ - public function testRejectsASchemaWhichRedefinesABuiltInType() + public function testRejectsASchemaWhichRedefinesABuiltInType() : void { $FakeString = new CustomScalarType([ 'name' => 'String', @@ -1691,7 +1695,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects a Schema which defines an object type twice') */ - public function testRejectsASchemaWhichDefinesAnObjectTypeTwice() + public function testRejectsASchemaWhichDefinesAnObjectTypeTwice() : void { $A = new ObjectType([ 'name' => 'SameName', @@ -1722,7 +1726,7 @@ class DefinitionTest extends TestCase /** * @see it('rejects a Schema which have same named objects implementing an interface') */ - public function testRejectsASchemaWhichHaveSameNamedObjectsImplementingAnInterface() + public function testRejectsASchemaWhichHaveSameNamedObjectsImplementingAnInterface() : void { $AnotherInterface = new InterfaceType([ 'name' => 'AnotherInterface', diff --git a/tests/Type/EnumTypeTest.php b/tests/Type/EnumTypeTest.php index 4a5b376..f8ab00a 100644 --- a/tests/Type/EnumTypeTest.php +++ b/tests/Type/EnumTypeTest.php @@ -182,7 +182,7 @@ class EnumTypeTest extends TestCase /** * @see it('accepts enum literals as input') */ - public function testAcceptsEnumLiteralsAsInput() + public function testAcceptsEnumLiteralsAsInput() : void { $this->assertEquals( ['data' => ['colorInt' => 1]], @@ -193,7 +193,7 @@ class EnumTypeTest extends TestCase /** * @see it('enum may be output type') */ - public function testEnumMayBeOutputType() + public function testEnumMayBeOutputType() : void { $this->assertEquals( ['data' => ['colorEnum' => 'GREEN']], @@ -204,7 +204,7 @@ class EnumTypeTest extends TestCase /** * @see it('enum may be both input and output type') */ - public function testEnumMayBeBothInputAndOutputType() + public function testEnumMayBeBothInputAndOutputType() : void { $this->assertEquals( ['data' => ['colorEnum' => 'GREEN']], @@ -215,7 +215,7 @@ class EnumTypeTest extends TestCase /** * @see it('does not accept string literals') */ - public function testDoesNotAcceptStringLiterals() + public function testDoesNotAcceptStringLiterals() : void { $this->expectFailure( '{ colorEnum(fromEnum: "GREEN") }', @@ -230,7 +230,7 @@ class EnumTypeTest extends TestCase /** * @see it('does not accept valuesNotInTheEnum') */ - public function testDoesNotAcceptValuesNotInTheEnum() + public function testDoesNotAcceptValuesNotInTheEnum() : void { $this->expectFailure( '{ colorEnum(fromEnum: GREENISH) }', @@ -245,7 +245,7 @@ class EnumTypeTest extends TestCase /** * @see it('does not accept values with incorrect casing') */ - public function testDoesNotAcceptValuesWithIncorrectCasing() + public function testDoesNotAcceptValuesWithIncorrectCasing() : void { $this->expectFailure( '{ colorEnum(fromEnum: green) }', @@ -260,7 +260,7 @@ class EnumTypeTest extends TestCase /** * @see it('does not accept incorrect internal value') */ - public function testDoesNotAcceptIncorrectInternalValue() + public function testDoesNotAcceptIncorrectInternalValue() : void { $this->expectFailure( '{ colorEnum(fromString: "GREEN") }', @@ -276,7 +276,7 @@ class EnumTypeTest extends TestCase /** * @see it('does not accept internal value in place of enum literal') */ - public function testDoesNotAcceptInternalValueInPlaceOfEnumLiteral() + public function testDoesNotAcceptInternalValueInPlaceOfEnumLiteral() : void { $this->expectFailure( '{ colorEnum(fromEnum: 1) }', @@ -288,7 +288,7 @@ class EnumTypeTest extends TestCase /** * @see it('does not accept enum literal in place of int') */ - public function testDoesNotAcceptEnumLiteralInPlaceOfInt() + public function testDoesNotAcceptEnumLiteralInPlaceOfInt() : void { $this->expectFailure( '{ colorEnum(fromInt: GREEN) }', @@ -300,7 +300,7 @@ class EnumTypeTest extends TestCase /** * @see it('accepts JSON string as enum variable') */ - public function testAcceptsJSONStringAsEnumVariable() + public function testAcceptsJSONStringAsEnumVariable() : void { $this->assertEquals( ['data' => ['colorEnum' => 'BLUE']], @@ -317,7 +317,7 @@ class EnumTypeTest extends TestCase /** * @see it('accepts enum literals as input arguments to mutations') */ - public function testAcceptsEnumLiteralsAsInputArgumentsToMutations() + public function testAcceptsEnumLiteralsAsInputArgumentsToMutations() : void { $this->assertEquals( ['data' => ['favoriteEnum' => 'GREEN']], @@ -335,7 +335,7 @@ class EnumTypeTest extends TestCase * @see it('accepts enum literals as input arguments to subscriptions') * @todo */ - public function testAcceptsEnumLiteralsAsInputArgumentsToSubscriptions() + public function testAcceptsEnumLiteralsAsInputArgumentsToSubscriptions() : void { $this->assertEquals( ['data' => ['subscribeToEnum' => 'GREEN']], @@ -352,7 +352,7 @@ class EnumTypeTest extends TestCase /** * @see it('does not accept internal value as enum variable') */ - public function testDoesNotAcceptInternalValueAsEnumVariable() + public function testDoesNotAcceptInternalValueAsEnumVariable() : void { $this->expectFailure( 'query test($color: Color!) { colorEnum(fromEnum: $color) }', @@ -364,7 +364,7 @@ class EnumTypeTest extends TestCase /** * @see it('does not accept string variables as enum input') */ - public function testDoesNotAcceptStringVariablesAsEnumInput() + public function testDoesNotAcceptStringVariablesAsEnumInput() : void { $this->expectFailure( 'query test($color: String!) { colorEnum(fromEnum: $color) }', @@ -376,7 +376,7 @@ class EnumTypeTest extends TestCase /** * @see it('does not accept internal value variable as enum input') */ - public function testDoesNotAcceptInternalValueVariableSsEnumInput() + public function testDoesNotAcceptInternalValueVariableSsEnumInput() : void { $this->expectFailure( 'query test($color: Int!) { colorEnum(fromEnum: $color) }', @@ -388,7 +388,7 @@ class EnumTypeTest extends TestCase /** * @see it('enum value may have an internal value of 0') */ - public function testEnumValueMayHaveAnInternalValueOf0() + public function testEnumValueMayHaveAnInternalValueOf0() : void { $this->assertEquals( ['data' => ['colorEnum' => 'RED', 'colorInt' => 0]], @@ -402,7 +402,7 @@ class EnumTypeTest extends TestCase /** * @see it('enum inputs may be nullable') */ - public function testEnumInputsMayBeNullable() + public function testEnumInputsMayBeNullable() : void { $this->assertEquals( ['data' => ['colorEnum' => null, 'colorInt' => null]], @@ -416,7 +416,7 @@ class EnumTypeTest extends TestCase /** * @see it('presents a getValues() API for complex enums') */ - public function testPresentsGetValuesAPIForComplexEnums() + public function testPresentsGetValuesAPIForComplexEnums() : void { $ComplexEnum = $this->ComplexEnum; $values = $ComplexEnum->getValues(); @@ -431,7 +431,7 @@ class EnumTypeTest extends TestCase /** * @see it('presents a getValue() API for complex enums') */ - public function testPresentsGetValueAPIForComplexEnums() + public function testPresentsGetValueAPIForComplexEnums() : void { $oneValue = $this->ComplexEnum->getValue('ONE'); $this->assertEquals('ONE', $oneValue->name); @@ -444,7 +444,7 @@ class EnumTypeTest extends TestCase /** * @see it('may be internally represented with complex values') */ - public function testMayBeInternallyRepresentedWithComplexValues() + public function testMayBeInternallyRepresentedWithComplexValues() : void { $result = GraphQL::executeQuery($this->schema, '{ first: complexEnum @@ -473,13 +473,13 @@ class EnumTypeTest extends TestCase /** * @see it('can be introspected without error') */ - public function testCanBeIntrospectedWithoutError() + public function testCanBeIntrospectedWithoutError() : void { $result = GraphQL::executeQuery($this->schema, Introspection::getIntrospectionQuery())->toArray(); $this->assertArrayNotHasKey('errors', $result); } - public function testAllowsSimpleArrayAsValues() + public function testAllowsSimpleArrayAsValues() : void { $q = '{ first: simpleEnum(fromName: "ONE") diff --git a/tests/Type/IntrospectionTest.php b/tests/Type/IntrospectionTest.php index 1eb3d95..b44a168 100644 --- a/tests/Type/IntrospectionTest.php +++ b/tests/Type/IntrospectionTest.php @@ -1171,9 +1171,8 @@ class IntrospectionTest extends TestCase /** * @see it('supports the __type root field') */ - public function testSupportsThe__typeRootField() + public function testSupportsTheTypeRootField() : void { - $TestType = new ObjectType([ 'name' => 'TestType', 'fields' => [ @@ -1204,7 +1203,7 @@ class IntrospectionTest extends TestCase /** * @see it('identifies deprecated fields') */ - public function testIdentifiesDeprecatedFields() + public function testIdentifiesDeprecatedFields() : void { $TestType = new ObjectType([ @@ -1259,7 +1258,7 @@ class IntrospectionTest extends TestCase /** * @see it('respects the includeDeprecated parameter for fields') */ - public function testRespectsTheIncludeDeprecatedParameterForFields() + public function testRespectsTheIncludeDeprecatedParameterForFields() : void { $TestType = new ObjectType([ 'name' => 'TestType', @@ -1324,7 +1323,7 @@ class IntrospectionTest extends TestCase /** * @see it('identifies deprecated enum values') */ - public function testIdentifiesDeprecatedEnumValues() + public function testIdentifiesDeprecatedEnumValues() : void { $TestEnum = new EnumType([ 'name' => 'TestEnum', @@ -1388,7 +1387,7 @@ class IntrospectionTest extends TestCase /** * @see it('respects the includeDeprecated parameter for enum values') */ - public function testRespectsTheIncludeDeprecatedParameterForEnumValues() + public function testRespectsTheIncludeDeprecatedParameterForEnumValues() : void { $TestEnum = new EnumType([ 'name' => 'TestEnum', @@ -1451,7 +1450,7 @@ class IntrospectionTest extends TestCase /** * @see it('fails as expected on the __type root field without an arg') */ - public function testFailsAsExpectedOnThe__typeRootFieldWithoutAnArg() + public function testFailsAsExpectedOnTheTypeRootFieldWithoutAnArg() : void { $TestType = new ObjectType([ 'name' => 'TestType', @@ -1483,7 +1482,7 @@ class IntrospectionTest extends TestCase /** * @see it('exposes descriptions on types and fields') */ - public function testExposesDescriptionsOnTypesAndFields() + public function testExposesDescriptionsOnTypesAndFields() : void { $QueryRoot = new ObjectType([ 'name' => 'QueryRoot', @@ -1543,7 +1542,7 @@ class IntrospectionTest extends TestCase /** * @see it('exposes descriptions on enums') */ - public function testExposesDescriptionsOnEnums() + public function testExposesDescriptionsOnEnums() : void { $QueryRoot = new ObjectType([ 'name' => 'QueryRoot', diff --git a/tests/Type/ResolutionTest.php b/tests/Type/ResolutionTest.php index ac7c3c1..f4b0a72 100644 --- a/tests/Type/ResolutionTest.php +++ b/tests/Type/ResolutionTest.php @@ -275,7 +275,7 @@ class ResolutionTest extends TestCase ]); } - public function testEagerTypeResolution() + public function testEagerTypeResolution() : void { // Has internal types by default: $eagerTypeResolution = new EagerResolution([]); @@ -460,7 +460,7 @@ class ResolutionTest extends TestCase $this->assertEquals($expectedDescriptor, $eagerTypeResolution->getDescriptor()); } - public function testLazyResolutionFollowsEagerResolution() + public function testLazyResolutionFollowsEagerResolution() : void { // Lazy resolution should work the same way as eager resolution works, except that it should load types on demand $eager = new EagerResolution([]); @@ -561,7 +561,7 @@ class ResolutionTest extends TestCase return $lazy; } - public function testLazyThrowsOnInvalidLoadedType() + public function testLazyThrowsOnInvalidLoadedType() : void { $lazy = $this->createLazy(); $this->expectException(InvariantViolation::class); @@ -569,7 +569,7 @@ class ResolutionTest extends TestCase $lazy->resolveType('int'); } - public function testLazyThrowsOnInvalidLoadedPossibleType() + public function testLazyThrowsOnInvalidLoadedPossibleType() : void { $tmp = new InterfaceType(['name' => 'a', 'fields' => []]); $lazy = $this->createLazy(); @@ -578,7 +578,7 @@ class ResolutionTest extends TestCase $lazy->resolvePossibleTypes($tmp); } - public function testLazyThrowsOnInvalidLoadedPossibleTypeWithInteger() + public function testLazyThrowsOnInvalidLoadedPossibleTypeWithInteger() : void { $tmp = new InterfaceType(['name' => 'b', 'fields' => []]); $lazy = $this->createLazy(); diff --git a/tests/Type/ResolveInfoTest.php b/tests/Type/ResolveInfoTest.php index d770a40..768f555 100644 --- a/tests/Type/ResolveInfoTest.php +++ b/tests/Type/ResolveInfoTest.php @@ -10,7 +10,7 @@ use PHPUnit\Framework\TestCase; class ResolveInfoTest extends TestCase { - public function testFieldSelection() + public function testFieldSelection() : void { $image = new ObjectType([ 'name' => 'Image', @@ -164,7 +164,7 @@ class ResolveInfoTest extends TestCase $this->assertEquals($expectedDeepSelection, $actualDeepSelection); } - public function testMergedFragmentsFieldSelection() + public function testMergedFragmentsFieldSelection() : void { $image = new ObjectType([ 'name' => 'Image', diff --git a/tests/Type/ScalarSerializationTest.php b/tests/Type/ScalarSerializationTest.php index e4f512a..e26f0a1 100644 --- a/tests/Type/ScalarSerializationTest.php +++ b/tests/Type/ScalarSerializationTest.php @@ -12,7 +12,7 @@ class ScalarSerializationTest extends TestCase /** * @see it('serializes output int') */ - public function testSerializesOutputInt() + public function testSerializesOutputInt() : void { $intType = Type::int(); @@ -26,7 +26,7 @@ class ScalarSerializationTest extends TestCase $this->assertSame(1, $intType->serialize(true)); } - public function testSerializesOutputIntCannotRepresentFloat1() + public function testSerializesOutputIntCannotRepresentFloat1() : void { // The GraphQL specification does not allow serializing non-integer values // as Int to avoid accidental data loss. @@ -36,7 +36,7 @@ class ScalarSerializationTest extends TestCase $intType->serialize(0.1); } - public function testSerializesOutputIntCannotRepresentFloat2() + public function testSerializesOutputIntCannotRepresentFloat2() : void { $intType = Type::int(); $this->expectException(Error::class); @@ -45,7 +45,7 @@ class ScalarSerializationTest extends TestCase } - public function testSerializesOutputIntCannotRepresentNegativeFloat() + public function testSerializesOutputIntCannotRepresentNegativeFloat() : void { $intType = Type::int(); $this->expectException(Error::class); @@ -54,7 +54,7 @@ class ScalarSerializationTest extends TestCase } - public function testSerializesOutputIntCannotRepresentNumericString() + public function testSerializesOutputIntCannotRepresentNumericString() : void { $intType = Type::int(); $this->expectException(Error::class); @@ -63,7 +63,7 @@ class ScalarSerializationTest extends TestCase } - public function testSerializesOutputIntCannotRepresentBiggerThan32Bits() + public function testSerializesOutputIntCannotRepresentBiggerThan32Bits() : void { // Maybe a safe PHP int, but bigger than 2^32, so not // representable as a GraphQL Int @@ -74,7 +74,7 @@ class ScalarSerializationTest extends TestCase } - public function testSerializesOutputIntCannotRepresentLowerThan32Bits() + public function testSerializesOutputIntCannotRepresentLowerThan32Bits() : void { $intType = Type::int(); $this->expectException(Error::class); @@ -82,7 +82,7 @@ class ScalarSerializationTest extends TestCase $intType->serialize(-9876504321); } - public function testSerializesOutputIntCannotRepresentBiggerThanSigned32Bits() + public function testSerializesOutputIntCannotRepresentBiggerThanSigned32Bits() : void { $intType = Type::int(); $this->expectException(Error::class); @@ -90,7 +90,7 @@ class ScalarSerializationTest extends TestCase $intType->serialize(1e100); } - public function testSerializesOutputIntCannotRepresentLowerThanSigned32Bits() + public function testSerializesOutputIntCannotRepresentLowerThanSigned32Bits() : void { $intType = Type::int(); $this->expectException(Error::class); @@ -98,7 +98,7 @@ class ScalarSerializationTest extends TestCase $intType->serialize(-1e100); } - public function testSerializesOutputIntCannotRepresentString() + public function testSerializesOutputIntCannotRepresentString() : void { $intType = Type::int(); $this->expectException(Error::class); @@ -107,7 +107,7 @@ class ScalarSerializationTest extends TestCase } - public function testSerializesOutputIntCannotRepresentEmptyString() + public function testSerializesOutputIntCannotRepresentEmptyString() : void { $intType = Type::int(); $this->expectException(Error::class); @@ -118,7 +118,7 @@ class ScalarSerializationTest extends TestCase /** * @see it('serializes output float') */ - public function testSerializesOutputFloat() + public function testSerializesOutputFloat() : void { $floatType = Type::float(); @@ -134,7 +134,7 @@ class ScalarSerializationTest extends TestCase $this->assertSame(1.0, $floatType->serialize(true)); } - public function testSerializesOutputFloatCannotRepresentString() + public function testSerializesOutputFloatCannotRepresentString() : void { $floatType = Type::float(); $this->expectException(Error::class); @@ -142,7 +142,7 @@ class ScalarSerializationTest extends TestCase $floatType->serialize('one'); } - public function testSerializesOutputFloatCannotRepresentEmptyString() + public function testSerializesOutputFloatCannotRepresentEmptyString() : void { $floatType = Type::float(); $this->expectException(Error::class); @@ -153,7 +153,7 @@ class ScalarSerializationTest extends TestCase /** * @see it('serializes output strings') */ - public function testSerializesOutputStrings() + public function testSerializesOutputStrings() : void { $stringType = Type::string(); @@ -166,7 +166,7 @@ class ScalarSerializationTest extends TestCase $this->assertSame('2', $stringType->serialize(new ObjectIdStub(2))); } - public function testSerializesOutputStringsCannotRepresentArray() + public function testSerializesOutputStringsCannotRepresentArray() : void { $stringType = Type::string(); $this->expectException(Error::class); @@ -174,7 +174,7 @@ class ScalarSerializationTest extends TestCase $stringType->serialize([]); } - public function testSerializesOutputStringsCannotRepresentObject() + public function testSerializesOutputStringsCannotRepresentObject() : void { $stringType = Type::string(); $this->expectException(Error::class); @@ -185,7 +185,7 @@ class ScalarSerializationTest extends TestCase /** * @see it('serializes output boolean') */ - public function testSerializesOutputBoolean() + public function testSerializesOutputBoolean() : void { $boolType = Type::boolean(); @@ -200,7 +200,7 @@ class ScalarSerializationTest extends TestCase // TODO: how should it behave on '0'? } - public function testSerializesOutputID() + public function testSerializesOutputID() : void { $idType = Type::id(); @@ -214,7 +214,7 @@ class ScalarSerializationTest extends TestCase $this->assertSame('2', $idType->serialize(new ObjectIdStub(2))); } - public function testSerializesOutputIDCannotRepresentObject() + public function testSerializesOutputIDCannotRepresentObject() : void { $idType = Type::id(); $this->expectException(Error::class); diff --git a/tests/Type/SchemaTest.php b/tests/Type/SchemaTest.php index fc354b1..7224622 100644 --- a/tests/Type/SchemaTest.php +++ b/tests/Type/SchemaTest.php @@ -93,7 +93,7 @@ class SchemaTest extends TestCase /** * @see it('throws human-reable error if schema.types is not defined') */ - public function testThrowsHumanReableErrorIfSchemaTypesIsNotDefined() + public function testThrowsHumanReableErrorIfSchemaTypesIsNotDefined() : void { $this->markTestSkipped("Can't check interface implementations without full schema scan"); @@ -111,7 +111,7 @@ class SchemaTest extends TestCase /** * @see it('includes input types only used in directives') */ - public function testIncludesInputTypesOnlyUsedInDirectives() + public function testIncludesInputTypesOnlyUsedInDirectives() : void { $typeMap = $this->schema->getTypeMap(); $this->assertArrayHasKey('DirInput', $typeMap); diff --git a/tests/Type/TypeLoaderTest.php b/tests/Type/TypeLoaderTest.php index a1c0233..1893ca7 100644 --- a/tests/Type/TypeLoaderTest.php +++ b/tests/Type/TypeLoaderTest.php @@ -151,7 +151,7 @@ class TypeLoaderTest extends TestCase }; } - public function testSchemaAcceptsTypeLoader() + public function testSchemaAcceptsTypeLoader() : void { $this->expectNotToPerformAssertions(); new Schema([ @@ -163,7 +163,7 @@ class TypeLoaderTest extends TestCase ]); } - public function testSchemaRejectsNonCallableTypeLoader() + public function testSchemaRejectsNonCallableTypeLoader() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage('Schema type loader must be callable if provided but got: []'); @@ -177,7 +177,7 @@ class TypeLoaderTest extends TestCase ]); } - public function testWorksWithoutTypeLoader() + public function testWorksWithoutTypeLoader() : void { $schema = new Schema([ 'query' => $this->query, @@ -215,7 +215,7 @@ class TypeLoaderTest extends TestCase $this->assertArraySubset($expectedTypeMap, $schema->getTypeMap()); } - public function testWorksWithTypeLoader() + public function testWorksWithTypeLoader() : void { $schema = new Schema([ 'query' => $this->query, @@ -241,7 +241,7 @@ class TypeLoaderTest extends TestCase $this->assertEquals(['Node', 'Content', 'PostStoryMutationInput'], $this->calls); } - public function testOnlyCallsLoaderOnce() + public function testOnlyCallsLoaderOnce() : void { $schema = new Schema([ 'query' => $this->query, @@ -255,7 +255,7 @@ class TypeLoaderTest extends TestCase $this->assertEquals(['Node'], $this->calls); } - public function testFailsOnNonExistentType() + public function testFailsOnNonExistentType() : void { $schema = new Schema([ 'query' => $this->query, @@ -268,7 +268,7 @@ class TypeLoaderTest extends TestCase $schema->getType('NonExistingType'); } - public function testFailsOnNonType() + public function testFailsOnNonType() : void { $schema = new Schema([ 'query' => $this->query, @@ -283,7 +283,7 @@ class TypeLoaderTest extends TestCase $schema->getType('Node'); } - public function testFailsOnInvalidLoad() + public function testFailsOnInvalidLoad() : void { $schema = new Schema([ 'query' => $this->query, @@ -298,7 +298,7 @@ class TypeLoaderTest extends TestCase $schema->getType('Node'); } - public function testPassesThroughAnExceptionInLoader() + public function testPassesThroughAnExceptionInLoader() : void { $schema = new Schema([ 'query' => $this->query, @@ -313,7 +313,7 @@ class TypeLoaderTest extends TestCase $schema->getType('Node'); } - public function testReturnsIdenticalResults() + public function testReturnsIdenticalResults() : void { $withoutLoader = new Schema([ 'query' => $this->query, @@ -332,7 +332,7 @@ class TypeLoaderTest extends TestCase $this->assertSame($withoutLoader->getDirectives(), $withLoader->getDirectives()); } - public function testSkipsLoaderForInternalTypes() + public function testSkipsLoaderForInternalTypes() : void { $schema = new Schema([ 'query' => $this->query, diff --git a/tests/Type/ValidationTest.php b/tests/Type/ValidationTest.php index 8fd4823..d388bb5 100644 --- a/tests/Type/ValidationTest.php +++ b/tests/Type/ValidationTest.php @@ -145,7 +145,7 @@ class ValidationTest extends TestCase } } - public function testRejectsTypesWithoutNames() + public function testRejectsTypesWithoutNames() : void { $this->assertEachCallableThrows([ function() { @@ -171,7 +171,7 @@ class ValidationTest extends TestCase /** * @see it('accepts a Schema whose query type is an object type') */ - public function testAcceptsASchemaWhoseQueryTypeIsAnObjectType() + public function testAcceptsASchemaWhoseQueryTypeIsAnObjectType() : void { $schema = BuildSchema::build(' type Query { @@ -194,7 +194,7 @@ class ValidationTest extends TestCase /** * @see it('accepts a Schema whose query and mutation types are object types') */ - public function testAcceptsASchemaWhoseQueryAndMutationTypesAreObjectTypes() + public function testAcceptsASchemaWhoseQueryAndMutationTypesAreObjectTypes() : void { $schema = BuildSchema::build(' type Query { @@ -227,7 +227,7 @@ class ValidationTest extends TestCase /** * @see it('accepts a Schema whose query and subscription types are object types') */ - public function testAcceptsASchemaWhoseQueryAndSubscriptionTypesAreObjectTypes() + public function testAcceptsASchemaWhoseQueryAndSubscriptionTypesAreObjectTypes() : void { $schema = BuildSchema::build(' type Query { @@ -260,7 +260,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a Schema without a query type') */ - public function testRejectsASchemaWithoutAQueryType() + public function testRejectsASchemaWithoutAQueryType() : void { $schema = BuildSchema::build(' type Mutation { @@ -296,7 +296,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a Schema whose query root type is not an Object type') */ - public function testRejectsASchemaWhoseQueryTypeIsNotAnObjectType() + public function testRejectsASchemaWhoseQueryTypeIsNotAnObjectType() : void { $schema = BuildSchema::build(' input Query { @@ -335,7 +335,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a Schema whose mutation type is an input type') */ - public function testRejectsASchemaWhoseMutationTypeIsAnInputType() + public function testRejectsASchemaWhoseMutationTypeIsAnInputType() : void { $schema = BuildSchema::build(' type Query { @@ -382,7 +382,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a Schema whose subscription type is an input type') */ - public function testRejectsASchemaWhoseSubscriptionTypeIsAnInputType() + public function testRejectsASchemaWhoseSubscriptionTypeIsAnInputType() : void { $schema = BuildSchema::build(' type Query { @@ -431,7 +431,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a Schema whose directives are incorrectly typed') */ - public function testRejectsASchemaWhoseDirectivesAreIncorrectlyTyped() + public function testRejectsASchemaWhoseDirectivesAreIncorrectlyTyped() : void { $schema = new Schema([ 'query' => $this->SomeObjectType, @@ -449,7 +449,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an Object type with fields object') */ - public function testAcceptsAnObjectTypeWithFieldsObject() + public function testAcceptsAnObjectTypeWithFieldsObject() : void { $schema = BuildSchema::build(' type Query { @@ -467,7 +467,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object type with missing fields') */ - public function testRejectsAnObjectTypeWithMissingFields() + public function testRejectsAnObjectTypeWithMissingFields() : void { $schema = BuildSchema::build(' type Query { @@ -513,7 +513,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object type with incorrectly named fields') */ - public function testRejectsAnObjectTypeWithIncorrectlyNamedFields() + public function testRejectsAnObjectTypeWithIncorrectlyNamedFields() : void { $schema = $this->schemaWithFieldType( new ObjectType([ @@ -533,7 +533,7 @@ class ValidationTest extends TestCase ); } - public function testAcceptsShorthandNotationForFields() + public function testAcceptsShorthandNotationForFields() : void { $this->expectNotToPerformAssertions(); $schema = $this->schemaWithFieldType( @@ -552,7 +552,7 @@ class ValidationTest extends TestCase /** * @see it('accepts field args with valid names') */ - public function testAcceptsFieldArgsWithValidNames() + public function testAcceptsFieldArgsWithValidNames() : void { $schema = $this->schemaWithFieldType(new ObjectType([ 'name' => 'SomeObject', @@ -571,7 +571,7 @@ class ValidationTest extends TestCase /** * @see it('rejects field arg with invalid names') */ - public function testRejectsFieldArgWithInvalidNames() + public function testRejectsFieldArgWithInvalidNames() : void { $QueryType = new ObjectType([ 'name' => 'SomeObject', @@ -597,7 +597,7 @@ class ValidationTest extends TestCase /** * @see it('accepts a Union type with member types') */ - public function testAcceptsAUnionTypeWithArrayTypes() + public function testAcceptsAUnionTypeWithArrayTypes() : void { $schema = BuildSchema::build(' type Query { @@ -623,7 +623,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a Union type with empty types') */ - public function testRejectsAUnionTypeWithEmptyTypes() + public function testRejectsAUnionTypeWithEmptyTypes() : void { $schema = BuildSchema::build(' type Query { @@ -644,7 +644,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a Union type with duplicated member type') */ - public function testRejectsAUnionTypeWithDuplicatedMemberType() + public function testRejectsAUnionTypeWithDuplicatedMemberType() : void { $schema = BuildSchema::build(' type Query { @@ -676,7 +676,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a Union type with non-Object members types') */ - public function testRejectsAUnionTypeWithNonObjectMembersType() + public function testRejectsAUnionTypeWithNonObjectMembersType() : void { $schema = BuildSchema::build(' type Query { @@ -735,7 +735,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an Input Object type with fields') */ - public function testAcceptsAnInputObjectTypeWithFields() + public function testAcceptsAnInputObjectTypeWithFields() : void { $schema = BuildSchema::build(' type Query { @@ -752,7 +752,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Input Object type with missing fields') */ - public function testRejectsAnInputObjectTypeWithMissingFields() + public function testRejectsAnInputObjectTypeWithMissingFields() : void { $schema = BuildSchema::build(' type Query { @@ -773,7 +773,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Input Object type with incorrectly typed fields') */ - public function testRejectsAnInputObjectTypeWithIncorrectlyTypedFields() + public function testRejectsAnInputObjectTypeWithIncorrectlyTypedFields() : void { $schema = BuildSchema::build(' type Query { @@ -809,7 +809,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Enum type without values') */ - public function testRejectsAnEnumTypeWithoutValues() + public function testRejectsAnEnumTypeWithoutValues() : void { $schema = BuildSchema::build(' type Query { @@ -830,7 +830,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Enum type with duplicate values') */ - public function testRejectsAnEnumTypeWithDuplicateValues() + public function testRejectsAnEnumTypeWithDuplicateValues() : void { $schema = BuildSchema::build(' type Query { @@ -851,7 +851,7 @@ class ValidationTest extends TestCase ); } - public function testDoesNotAllowIsDeprecatedWithoutDeprecationReasonOnEnum() + public function testDoesNotAllowIsDeprecatedWithoutDeprecationReasonOnEnum() : void { $enum = new EnumType([ 'name' => 'SomeEnum', @@ -892,7 +892,7 @@ class ValidationTest extends TestCase * @see it('rejects an Enum type with incorrectly named values') * @dataProvider invalidEnumValueName */ - public function testRejectsAnEnumTypeWithIncorrectlyNamedValues($name, $expectedMessage) + public function testRejectsAnEnumTypeWithIncorrectlyNamedValues($name, $expectedMessage) : void { $schema = $this->schemaWithEnum($name); @@ -909,7 +909,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an output type as an Object field type') */ - public function testAcceptsAnOutputTypeAsNnObjectFieldType() + public function testAcceptsAnOutputTypeAsNnObjectFieldType() : void { foreach ($this->outputTypes as $type) { $schema = $this->schemaWithObjectFieldOfType($type); @@ -920,7 +920,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an empty Object field type') */ - public function testRejectsAnEmptyObjectFieldType() + public function testRejectsAnEmptyObjectFieldType() : void { $schema = $this->schemaWithObjectFieldOfType(null); @@ -935,7 +935,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a non-output type as an Object field type') */ - public function testRejectsANonOutputTypeAsAnObjectFieldType() + public function testRejectsANonOutputTypeAsAnObjectFieldType() : void { foreach ($this->notOutputTypes as $type) { $schema = $this->schemaWithObjectFieldOfType($type); @@ -952,7 +952,7 @@ class ValidationTest extends TestCase /** * @see it('rejects with relevant locations for a non-output type as an Object field type') */ - public function testRejectsWithReleventLocationsForANonOutputTypeAsAnObjectFieldType() + public function testRejectsWithReleventLocationsForANonOutputTypeAsAnObjectFieldType() : void { $schema = BuildSchema::build(' type Query { @@ -977,7 +977,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object implementing a non-type values') */ - public function testRejectsAnObjectImplementingANonTypeValues() + public function testRejectsAnObjectImplementingANonTypeValues() : void { $schema = new Schema([ 'query' => new ObjectType([ @@ -999,7 +999,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object implementing a non-Interface type') */ - public function testRejectsAnObjectImplementingANonInterfaceType() + public function testRejectsAnObjectImplementingANonInterfaceType() : void { $schema = BuildSchema::build(' type Query { @@ -1026,7 +1026,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object implementing the same interface twice') */ - public function testRejectsAnObjectImplementingTheSameInterfaceTwice() + public function testRejectsAnObjectImplementingTheSameInterfaceTwice() : void { $schema = BuildSchema::build(' type Query { @@ -1053,7 +1053,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object implementing the same interface twice due to extension') */ - public function testRejectsAnObjectImplementingTheSameInterfaceTwiceDueToExtension() + public function testRejectsAnObjectImplementingTheSameInterfaceTwiceDueToExtension() : void { $this->expectNotToPerformAssertions(); $this->markTestIncomplete('extend does not work this way (yet).'); @@ -1086,7 +1086,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an output type as an Interface field type') */ - public function testAcceptsAnOutputTypeAsAnInterfaceFieldType() + public function testAcceptsAnOutputTypeAsAnInterfaceFieldType() : void { foreach ($this->outputTypes as $type) { $schema = $this->schemaWithInterfaceFieldOfType($type); @@ -1097,7 +1097,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an empty Interface field type') */ - public function testRejectsAnEmptyInterfaceFieldType() + public function testRejectsAnEmptyInterfaceFieldType() : void { $schema = $this->schemaWithInterfaceFieldOfType(null); $this->assertContainsValidationMessage( @@ -1111,7 +1111,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a non-output type as an Interface field type') */ - public function testRejectsANonOutputTypeAsAnInterfaceFieldType() + public function testRejectsANonOutputTypeAsAnInterfaceFieldType() : void { foreach ($this->notOutputTypes as $type) { $schema = $this->schemaWithInterfaceFieldOfType($type); @@ -1128,7 +1128,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a non-output type as an Interface field type with locations') */ - public function testRejectsANonOutputTypeAsAnInterfaceFieldTypeWithLocations() + public function testRejectsANonOutputTypeAsAnInterfaceFieldTypeWithLocations() : void { $schema = BuildSchema::build(' type Query { @@ -1157,7 +1157,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an input type as a field arg type') */ - public function testAcceptsAnInputTypeAsAFieldArgType() + public function testAcceptsAnInputTypeAsAFieldArgType() : void { foreach ($this->inputTypes as $type) { $schema = $this->schemaWithArgOfType($type); @@ -1168,7 +1168,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an empty field arg type') */ - public function testRejectsAnEmptyFieldArgType() + public function testRejectsAnEmptyFieldArgType() : void { $schema = $this->schemaWithArgOfType(null); $this->assertContainsValidationMessage( @@ -1182,7 +1182,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a non-input type as a field arg type') */ - public function testRejectsANonInputTypeAsAFieldArgType() + public function testRejectsANonInputTypeAsAFieldArgType() : void { foreach ($this->notInputTypes as $type) { $schema = $this->schemaWithArgOfType($type); @@ -1198,7 +1198,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a non-input type as a field arg with locations') */ - public function testANonInputTypeAsAFieldArgWithLocations() + public function testANonInputTypeAsAFieldArgWithLocations() : void { $schema = BuildSchema::build(' type Query { @@ -1223,7 +1223,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an input type as an input field type') */ - public function testAcceptsAnInputTypeAsAnInputFieldType() + public function testAcceptsAnInputTypeAsAnInputFieldType() : void { foreach ($this->inputTypes as $type) { $schema = $this->schemaWithInputFieldOfType($type); @@ -1234,7 +1234,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an empty input field type') */ - public function testRejectsAnEmptyInputFieldType() + public function testRejectsAnEmptyInputFieldType() : void { $schema = $this->schemaWithInputFieldOfType(null); $this->assertContainsValidationMessage( @@ -1248,7 +1248,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a non-input type as an input field type') */ - public function testRejectsANonInputTypeAsAnInputFieldType() + public function testRejectsANonInputTypeAsAnInputFieldType() : void { foreach ($this->notInputTypes as $type) { $schema = $this->schemaWithInputFieldOfType($type); @@ -1264,7 +1264,7 @@ class ValidationTest extends TestCase /** * @see it('rejects a non-input type as an input object field with locations') */ - public function testRejectsANonInputTypeAsAnInputObjectFieldWithLocations() + public function testRejectsANonInputTypeAsAnInputObjectFieldWithLocations() : void { $schema = BuildSchema::build(' type Query { @@ -1293,7 +1293,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an Object which implements an Interface') */ - public function testAcceptsAnObjectWhichImplementsAnInterface() + public function testAcceptsAnObjectWhichImplementsAnInterface() : void { $schema = BuildSchema::build(' type Query { @@ -1318,7 +1318,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an Object which implements an Interface along with more fields') */ - public function testAcceptsAnObjectWhichImplementsAnInterfaceAlongWithMoreFields() + public function testAcceptsAnObjectWhichImplementsAnInterfaceAlongWithMoreFields() : void { $schema = BuildSchema::build(' type Query { @@ -1344,7 +1344,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an Object which implements an Interface field along with additional optional arguments') */ - public function testAcceptsAnObjectWhichImplementsAnInterfaceFieldAlongWithAdditionalOptionalArguments() + public function testAcceptsAnObjectWhichImplementsAnInterfaceFieldAlongWithAdditionalOptionalArguments() : void { $schema = BuildSchema::build(' type Query { @@ -1369,7 +1369,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object missing an Interface field') */ - public function testRejectsAnObjectMissingAnInterfaceField() + public function testRejectsAnObjectMissingAnInterfaceField() : void { $schema = BuildSchema::build(' type Query { @@ -1398,7 +1398,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object with an incorrectly typed Interface field') */ - public function testRejectsAnObjectWithAnIncorrectlyTypedInterfaceField() + public function testRejectsAnObjectWithAnIncorrectlyTypedInterfaceField() : void { $schema = BuildSchema::build(' type Query { @@ -1427,7 +1427,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object with a differently typed Interface field') */ - public function testRejectsAnObjectWithADifferentlyTypedInterfaceField() + public function testRejectsAnObjectWithADifferentlyTypedInterfaceField() : void { $schema = BuildSchema::build(' type Query { @@ -1459,7 +1459,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an Object with a subtyped Interface field (interface)') */ - public function testAcceptsAnObjectWithASubtypedInterfaceFieldForInterface() + public function testAcceptsAnObjectWithASubtypedInterfaceFieldForInterface() : void { $schema = BuildSchema::build(' type Query { @@ -1481,7 +1481,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an Object with a subtyped Interface field (union)') */ - public function testAcceptsAnObjectWithASubtypedInterfaceFieldForUnion() + public function testAcceptsAnObjectWithASubtypedInterfaceFieldForUnion() : void { $schema = BuildSchema::build(' type Query { @@ -1509,7 +1509,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object missing an Interface argument') */ - public function testRejectsAnObjectMissingAnInterfaceArgument() + public function testRejectsAnObjectMissingAnInterfaceArgument() : void { $schema = BuildSchema::build(' type Query { @@ -1538,7 +1538,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object with an incorrectly typed Interface argument') */ - public function testRejectsAnObjectWithAnIncorrectlyTypedInterfaceArgument() + public function testRejectsAnObjectWithAnIncorrectlyTypedInterfaceArgument() : void { $schema = BuildSchema::build(' type Query { @@ -1567,7 +1567,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object with both an incorrectly typed field and argument') */ - public function testRejectsAnObjectWithBothAnIncorrectlyTypedFieldAndArgument() + public function testRejectsAnObjectWithBothAnIncorrectlyTypedFieldAndArgument() : void { $schema = BuildSchema::build(' type Query { @@ -1600,7 +1600,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object which implements an Interface field along with additional required arguments') */ - public function testRejectsAnObjectWhichImplementsAnInterfaceFieldAlongWithAdditionalRequiredArguments() + public function testRejectsAnObjectWhichImplementsAnInterfaceFieldAlongWithAdditionalRequiredArguments() : void { $schema = BuildSchema::build(' type Query { @@ -1630,7 +1630,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an Object with an equivalently wrapped Interface field type') */ - public function testAcceptsAnObjectWithAnEquivalentlyWrappedInterfaceFieldType() + public function testAcceptsAnObjectWithAnEquivalentlyWrappedInterfaceFieldType() : void { $schema = BuildSchema::build(' type Query { @@ -1652,7 +1652,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object with a non-list Interface field list type') */ - public function testRejectsAnObjectWithANonListInterfaceFieldListType() + public function testRejectsAnObjectWithANonListInterfaceFieldListType() : void { $schema = BuildSchema::build(' type Query { @@ -1681,7 +1681,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object with a list Interface field non-list type') */ - public function testRejectsAnObjectWithAListInterfaceFieldNonListType() + public function testRejectsAnObjectWithAListInterfaceFieldNonListType() : void { $schema = BuildSchema::build(' type Query { @@ -1710,7 +1710,7 @@ class ValidationTest extends TestCase /** * @see it('accepts an Object with a subset non-null Interface field type') */ - public function testAcceptsAnObjectWithASubsetNonNullInterfaceFieldType() + public function testAcceptsAnObjectWithASubsetNonNullInterfaceFieldType() : void { $schema = BuildSchema::build(' type Query { @@ -1732,7 +1732,7 @@ class ValidationTest extends TestCase /** * @see it('rejects an Object with a superset nullable Interface field type') */ - public function testRejectsAnObjectWithASupersetNullableInterfaceFieldType() + public function testRejectsAnObjectWithASupersetNullableInterfaceFieldType() : void { $schema = BuildSchema::build(' type Query { @@ -1758,7 +1758,7 @@ class ValidationTest extends TestCase ); } - public function testRejectsDifferentInstancesOfTheSameType() + public function testRejectsDifferentInstancesOfTheSameType() : void { // Invalid: always creates new instance vs returning one from registry $typeLoader = function($name) use (&$typeLoader) { diff --git a/tests/Utils/AssertValidNameTest.php b/tests/Utils/AssertValidNameTest.php index 81e3010..87fbfea 100644 --- a/tests/Utils/AssertValidNameTest.php +++ b/tests/Utils/AssertValidNameTest.php @@ -13,7 +13,7 @@ class AssertValidNameTest extends TestCase /** * @see it('throws for use of leading double underscores') */ - public function testThrowsForUseOfLeadingDoubleUnderscores() + public function testThrowsForUseOfLeadingDoubleUnderscores() : void { $this->expectException(Error::class); $this->expectExceptionMessage('"__bad" must not begin with "__", which is reserved by GraphQL introspection.'); @@ -23,7 +23,7 @@ class AssertValidNameTest extends TestCase /** * @see it('throws for non-strings') */ - public function testThrowsForNonStrings() + public function testThrowsForNonStrings() : void { $this->expectException(InvariantViolation::class); $this->expectExceptionMessage('Expected string'); @@ -33,7 +33,7 @@ class AssertValidNameTest extends TestCase /** * @see it('throws for names with invalid characters') */ - public function testThrowsForNamesWithInvalidCharacters() + public function testThrowsForNamesWithInvalidCharacters() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Names must match'); diff --git a/tests/Utils/AstFromValueTest.php b/tests/Utils/AstFromValueTest.php index ddeb698..777dddb 100644 --- a/tests/Utils/AstFromValueTest.php +++ b/tests/Utils/AstFromValueTest.php @@ -24,7 +24,7 @@ class AstFromValueTest extends TestCase /** * @see it('converts boolean values to ASTs') */ - public function testConvertsBooleanValueToASTs() + public function testConvertsBooleanValueToASTs() : void { $this->assertEquals(new BooleanValueNode(['value' => true]), AST::astFromValue(true, Type::boolean())); $this->assertEquals(new BooleanValueNode(['value' => false]), AST::astFromValue(false, Type::boolean())); @@ -38,7 +38,7 @@ class AstFromValueTest extends TestCase /** * @see it('converts Int values to Int ASTs') */ - public function testConvertsIntValuesToASTs() + public function testConvertsIntValuesToASTs() : void { $this->assertEquals(new IntValueNode(['value' => '-1']), AST::astFromValue(-1, Type::int())); $this->assertEquals(new IntValueNode(['value' => '123']), AST::astFromValue(123.0, Type::int())); @@ -46,7 +46,7 @@ class AstFromValueTest extends TestCase $this->assertEquals(new IntValueNode(['value' => '0']), AST::astFromValue(0e4, Type::int())); } - public function testConvertsIntValuesToASTsCannotRepresentNonInteger() + public function testConvertsIntValuesToASTsCannotRepresentNonInteger() : void { // GraphQL spec does not allow coercing non-integer values to Int to avoid // accidental data loss. @@ -55,7 +55,7 @@ class AstFromValueTest extends TestCase AST::astFromValue(123.5, Type::int()); } - public function testConvertsIntValuesToASTsCannotRepresentNon32bitsInteger() + public function testConvertsIntValuesToASTsCannotRepresentNon32bitsInteger() : void { $this->expectException(\Throwable::class); $this->expectExceptionMessage('Int cannot represent non 32-bit signed integer value: 1.0E+40'); @@ -65,7 +65,7 @@ class AstFromValueTest extends TestCase /** * @see it('converts Float values to Int/Float ASTs') */ - public function testConvertsFloatValuesToIntOrFloatASTs() + public function testConvertsFloatValuesToIntOrFloatASTs() : void { $this->assertEquals(new IntValueNode(['value' => '-1']), AST::astFromValue(-1, Type::float())); $this->assertEquals(new IntValueNode(['value' => '123']), AST::astFromValue(123, Type::float())); @@ -79,7 +79,7 @@ class AstFromValueTest extends TestCase /** * @see it('converts String values to String ASTs') */ - public function testConvertsStringValuesToASTs() + public function testConvertsStringValuesToASTs() : void { $this->assertEquals(new StringValueNode(['value' => 'hello']), AST::astFromValue('hello', Type::string())); $this->assertEquals(new StringValueNode(['value' => 'VALUE']), AST::astFromValue('VALUE', Type::string())); @@ -93,7 +93,7 @@ class AstFromValueTest extends TestCase /** * @see it('converts ID values to Int/String ASTs') */ - public function testConvertIdValuesToIntOrStringASTs() + public function testConvertIdValuesToIntOrStringASTs() : void { $this->assertEquals(new StringValueNode(['value' => 'hello']), AST::astFromValue('hello', Type::id())); $this->assertEquals(new StringValueNode(['value' => 'VALUE']), AST::astFromValue('VALUE', Type::id())); @@ -110,7 +110,7 @@ class AstFromValueTest extends TestCase /** * @see it('does not converts NonNull values to NullValue') */ - public function testDoesNotConvertsNonNullValuestoNullValue() + public function testDoesNotConvertsNonNullValuestoNullValue() : void { $this->assertSame(null, AST::astFromValue(null, Type::nonNull(Type::boolean()))); } @@ -118,7 +118,7 @@ class AstFromValueTest extends TestCase /** * @see it('converts string values to Enum ASTs if possible') */ - public function testConvertsStringValuesToEnumASTsIfPossible() + public function testConvertsStringValuesToEnumASTsIfPossible() : void { $this->assertEquals(new EnumValueNode(['value' => 'HELLO']), AST::astFromValue('HELLO', $this->myEnum())); $this->assertEquals(new EnumValueNode(['value' => 'COMPLEX']), AST::astFromValue($this->complexValue(), $this->myEnum())); @@ -133,7 +133,7 @@ class AstFromValueTest extends TestCase /** * @see it('converts array values to List ASTs') */ - public function testConvertsArrayValuesToListASTs() + public function testConvertsArrayValuesToListASTs() : void { $value1 = new ListValueNode([ 'values' => [ @@ -155,7 +155,7 @@ class AstFromValueTest extends TestCase /** * @see it('converts list singletons') */ - public function testConvertsListSingletons() + public function testConvertsListSingletons() : void { $this->assertEquals(new StringValueNode(['value' => 'FOO']), AST::astFromValue('FOO', Type::listOf(Type::string()))); } @@ -163,7 +163,7 @@ class AstFromValueTest extends TestCase /** * @see it('converts input objects') */ - public function testConvertsInputObjects() + public function testConvertsInputObjects() : void { $inputObj = new InputObjectType([ 'name' => 'MyInputObj', @@ -188,7 +188,7 @@ class AstFromValueTest extends TestCase /** * @see it('converts input objects with explicit nulls') */ - public function testConvertsInputObjectsWithExplicitNulls() + public function testConvertsInputObjectsWithExplicitNulls() : void { $inputObj = new InputObjectType([ 'name' => 'MyInputObj', diff --git a/tests/Utils/AstFromValueUntypedTest.php b/tests/Utils/AstFromValueUntypedTest.php index 790156d..eb168cf 100644 --- a/tests/Utils/AstFromValueUntypedTest.php +++ b/tests/Utils/AstFromValueUntypedTest.php @@ -19,7 +19,7 @@ class AstFromValueUntypedTest extends TestCase /** * @see it('parses simple values') */ - public function testParsesSimpleValues() + public function testParsesSimpleValues() : void { $this->assertTestCase('null', null); $this->assertTestCase('true', true); @@ -32,7 +32,7 @@ class AstFromValueUntypedTest extends TestCase /** * @see it('parses lists of values') */ - public function testParsesListsOfValues() + public function testParsesListsOfValues() : void { $this->assertTestCase('[true, false]', [true, false]); $this->assertTestCase('[true, 123.45]', [true, 123.45]); @@ -43,7 +43,7 @@ class AstFromValueUntypedTest extends TestCase /** * @see it('parses input objects') */ - public function testParsesInputObjects() + public function testParsesInputObjects() : void { $this->assertTestCase( '{ int: 123, bool: false }', @@ -59,7 +59,7 @@ class AstFromValueUntypedTest extends TestCase /** * @see it('parses enum values as plain strings') */ - public function testParsesEnumValuesAsPlainStrings() + public function testParsesEnumValuesAsPlainStrings() : void { $this->assertTestCase( 'TEST_ENUM_VALUE', @@ -75,7 +75,7 @@ class AstFromValueUntypedTest extends TestCase /** * @see it('parses enum values as plain strings') */ - public function testParsesVariables() + public function testParsesVariables() : void { $this->assertTestCase( '$testVariable', diff --git a/tests/Utils/BreakingChangesFinderTest.php b/tests/Utils/BreakingChangesFinderTest.php index 11eb466..37f575d 100644 --- a/tests/Utils/BreakingChangesFinderTest.php +++ b/tests/Utils/BreakingChangesFinderTest.php @@ -36,7 +36,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a type was removed or not') */ - public function testShouldDetectIfTypeWasRemovedOrNot() + public function testShouldDetectIfTypeWasRemovedOrNot() : void { $type1 = new ObjectType([ 'name' => 'Type1', @@ -77,7 +77,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a type changed its type') */ - public function testShouldDetectIfATypeChangedItsType() + public function testShouldDetectIfATypeChangedItsType() : void { $objectType = new ObjectType([ 'name' => 'ObjectType', @@ -124,7 +124,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a field on a type was deleted or changed type') */ - public function testShouldDetectIfAFieldOnATypeWasDeletedOrChangedType() + public function testShouldDetectIfAFieldOnATypeWasDeletedOrChangedType() : void { $typeA = new ObjectType([ 'name' => 'TypeA', @@ -268,7 +268,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if fields on input types changed kind or were removed') */ - public function testShouldDetectIfFieldsOnInputTypesChangedKindOrWereRemoved() + public function testShouldDetectIfFieldsOnInputTypesChangedKindOrWereRemoved() : void { $oldInputType = new InputObjectType([ 'name' => 'InputType1', @@ -432,7 +432,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a non-null field is added to an input type') */ - public function testShouldDetectIfANonNullFieldIsAddedToAnInputType() + public function testShouldDetectIfANonNullFieldIsAddedToAnInputType() : void { $oldInputType = new InputObjectType([ 'name' => 'InputType1', @@ -476,7 +476,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a type was removed from a union type') */ - public function testShouldRetectIfATypeWasRemovedFromAUnionType() + public function testShouldRetectIfATypeWasRemovedFromAUnionType() : void { $type1 = new ObjectType([ 'name' => 'Type1', @@ -539,7 +539,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a value was removed from an enum type') */ - public function testShouldDetectIfAValueWasRemovedFromAnEnumType() + public function testShouldDetectIfAValueWasRemovedFromAnEnumType() : void { $oldEnumType = new EnumType([ 'name' => 'EnumType1', @@ -584,7 +584,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a field argument was removed') */ - public function testShouldDetectIfAFieldArgumentWasRemoved() + public function testShouldDetectIfAFieldArgumentWasRemoved() : void { $oldType = new ObjectType([ 'name' => 'Type1', @@ -666,7 +666,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a field argument has changed type') */ - public function testShouldDetectIfAFieldArgumentHasChangedType() + public function testShouldDetectIfAFieldArgumentHasChangedType() : void { $oldType = new ObjectType([ 'name' => 'Type1', @@ -787,7 +787,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a non-null field argument was added') */ - public function testShouldDetectIfANonNullFieldArgumentWasAdded() + public function testShouldDetectIfANonNullFieldArgumentWasAdded() : void { $oldType = new ObjectType([ 'name' => 'Type1', @@ -836,7 +836,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should not flag args with the same type signature as breaking') */ - public function testShouldNotFlagArgsWithTheSameTypeSignatureAsBreaking() + public function testShouldNotFlagArgsWithTheSameTypeSignatureAsBreaking() : void { $inputType1a = new InputObjectType([ 'name' => 'InputType1', @@ -893,7 +893,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should consider args that move away from NonNull as non-breaking') */ - public function testShouldConsiderArgsThatMoveAwayFromNonNullAsNonBreaking() + public function testShouldConsiderArgsThatMoveAwayFromNonNullAsNonBreaking() : void { $oldType = new ObjectType([ 'name' => 'Type1', @@ -933,7 +933,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect interfaces removed from types') */ - public function testShouldDetectInterfacesRemovedFromTypes() + public function testShouldDetectInterfacesRemovedFromTypes() : void { $interface1 = new InterfaceType([ 'name' => 'Interface1', @@ -980,7 +980,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect all breaking changes') */ - public function testShouldDetectAllBreakingChanges() + public function testShouldDetectAllBreakingChanges() : void { $typeThatGetsRemoved = new ObjectType([ 'name' => 'TypeThatGetsRemoved', @@ -1246,7 +1246,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a directive was explicitly removed') */ - public function testShouldDetectIfADirectiveWasExplicitlyRemoved() + public function testShouldDetectIfADirectiveWasExplicitlyRemoved() : void { $oldSchema = new Schema([ 'directives' => [Directive::skipDirective(), Directive::includeDirective()], @@ -1271,7 +1271,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a directive was implicitly removed') */ - public function testShouldDetectIfADirectiveWasImplicitlyRemoved() + public function testShouldDetectIfADirectiveWasImplicitlyRemoved() : void { $oldSchema = new Schema([]); @@ -1294,7 +1294,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a directive argument was removed') */ - public function testShouldDetectIfADirectiveArgumentWasRemoved() + public function testShouldDetectIfADirectiveArgumentWasRemoved() : void { $oldSchema = new Schema([ 'directives' => [ @@ -1332,7 +1332,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a non-nullable directive argument was added') */ - public function testShouldDetectIfANonNullableDirectiveArgumentWasAdded() + public function testShouldDetectIfANonNullableDirectiveArgumentWasAdded() : void { $oldSchema = new Schema([ 'directives' => [ @@ -1371,7 +1371,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect locations removed from a directive') */ - public function testShouldDetectLocationsRemovedFromADirective() + public function testShouldDetectLocationsRemovedFromADirective() : void { $d1 = new Directive([ 'name' => 'Directive Name', @@ -1389,7 +1389,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect locations removed directives within a schema') */ - public function testShouldDetectLocationsRemovedDirectiveWithinASchema() + public function testShouldDetectLocationsRemovedDirectiveWithinASchema() : void { $oldSchema = new Schema([ 'directives' => [ @@ -1428,7 +1428,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if an argument's defaultValue has changed') */ - public function testShouldDetectIfAnArgumentsDefaultValueHasChanged() + public function testShouldDetectIfAnArgumentsDefaultValueHasChanged() : void { $oldType = new ObjectType([ 'name' => 'Type1', @@ -1486,7 +1486,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a value was added to an enum type') */ - public function testShouldDetectIfAValueWasAddedToAnEnumType() + public function testShouldDetectIfAValueWasAddedToAnEnumType() : void { $oldEnumType = new EnumType([ 'name' => 'EnumType1', @@ -1530,7 +1530,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect interfaces added to types') */ - public function testShouldDetectInterfacesAddedToTypes() + public function testShouldDetectInterfacesAddedToTypes() : void { $interface1 = new InterfaceType([ 'name' => 'Interface1', @@ -1579,7 +1579,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a type was added to a union type') */ - public function testShouldDetectIfATypeWasAddedToAUnionType() + public function testShouldDetectIfATypeWasAddedToAUnionType() : void { $type1 = new ObjectType([ 'name' => 'Type1', @@ -1637,7 +1637,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a nullable field was added to an input') */ - public function testShouldDetectIfANullableFieldWasAddedToAnInput() + public function testShouldDetectIfANullableFieldWasAddedToAnInput() : void { $oldInputType = new InputObjectType([ 'name' => 'InputType1', @@ -1686,7 +1686,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should find all dangerous changes') */ - public function testShouldFindAllDangerousChanges() + public function testShouldFindAllDangerousChanges() : void { $enumThatGainsAValueOld = new EnumType([ 'name' => 'EnumType1', @@ -1822,7 +1822,7 @@ class BreakingChangesFinderTest extends TestCase /** * @see it('should detect if a nullable field argument was added') */ - public function testShouldDetectIfANullableFieldArgumentWasAdded() + public function testShouldDetectIfANullableFieldArgumentWasAdded() : void { $oldType = new ObjectType([ 'name' => 'Type1', diff --git a/tests/Utils/BuildSchemaTest.php b/tests/Utils/BuildSchemaTest.php index 34b905b..eb0e619 100644 --- a/tests/Utils/BuildSchemaTest.php +++ b/tests/Utils/BuildSchemaTest.php @@ -29,7 +29,7 @@ class BuildSchemaTest extends TestCase /** * @see it('can use built schema for limited execution') */ - public function testUseBuiltSchemaForLimitedExecution() + public function testUseBuiltSchemaForLimitedExecution() : void { $schema = BuildSchema::buildAST(Parser::parse(' type Query { @@ -44,7 +44,7 @@ class BuildSchemaTest extends TestCase /** * @see it('can build a schema directly from the source') */ - public function testBuildSchemaDirectlyFromSource() + public function testBuildSchemaDirectlyFromSource() : void { $schema = BuildSchema::build(" type Query { @@ -69,7 +69,7 @@ class BuildSchemaTest extends TestCase /** * @see it('Simple Type') */ - public function testSimpleType() + public function testSimpleType() : void { $body = ' type HelloScalars { @@ -87,7 +87,7 @@ type HelloScalars { /** * @see it('With directives') */ - public function testWithDirectives() + public function testWithDirectives() : void { $body = ' directive @foo(arg: Int) on FIELD @@ -103,7 +103,7 @@ type Query { /** * @see it('Supports descriptions') */ - public function testSupportsDescriptions() + public function testSupportsDescriptions() : void { $body = ' """This is a directive""" @@ -135,7 +135,7 @@ type Query { /** * @see it('Supports option for comment descriptions') */ - public function testSupportsOptionForCommentDescriptions() + public function testSupportsOptionForCommentDescriptions() : void { $body = ' # This is a directive @@ -166,7 +166,7 @@ type Query { /** * @see it('Maintains @skip & @include') */ - public function testMaintainsSkipAndInclude() + public function testMaintainsSkipAndInclude() : void { $body = ' type Query { @@ -183,7 +183,7 @@ type Query { /** * @see it('Overriding directives excludes specified') */ - public function testOverridingDirectivesExcludesSpecified() + public function testOverridingDirectivesExcludesSpecified() : void { $body = ' directive @skip on FIELD @@ -204,7 +204,7 @@ type Query { /** * @see it('Adding directives maintains @skip & @include') */ - public function testAddingDirectivesMaintainsSkipAndInclude() + public function testAddingDirectivesMaintainsSkipAndInclude() : void { $body = ' directive @foo(arg: Int) on FIELD @@ -223,7 +223,7 @@ type Query { /** * @see it('Type modifiers') */ - public function testTypeModifiers() + public function testTypeModifiers() : void { $body = ' type HelloScalars { @@ -241,7 +241,7 @@ type HelloScalars { /** * @see it('Recursive type') */ - public function testRecursiveType() + public function testRecursiveType() : void { $body = ' type Query { @@ -256,7 +256,7 @@ type Query { /** * @see it('Two types circular') */ - public function testTwoTypesCircular() + public function testTwoTypesCircular() : void { $body = ' schema { @@ -280,7 +280,7 @@ type TypeTwo { /** * @see it('Single argument field') */ - public function testSingleArgumentField() + public function testSingleArgumentField() : void { $body = ' type Query { @@ -298,7 +298,7 @@ type Query { /** * @see it('Simple type with multiple arguments') */ - public function testSimpleTypeWithMultipleArguments() + public function testSimpleTypeWithMultipleArguments() : void { $body = ' type Query { @@ -312,7 +312,7 @@ type Query { /** * @see it('Simple type with interface') */ - public function testSimpleTypeWithInterface() + public function testSimpleTypeWithInterface() : void { $body = ' type Query implements WorldInterface { @@ -330,7 +330,7 @@ interface WorldInterface { /** * @see it('Simple output enum') */ - public function testSimpleOutputEnum() + public function testSimpleOutputEnum() : void { $body = ' enum Hello { @@ -348,7 +348,7 @@ type Query { /** * @see it('Simple input enum') */ - public function testSimpleInputEnum() + public function testSimpleInputEnum() : void { $body = ' enum Hello { @@ -366,7 +366,7 @@ type Query { /** * @see it('Multiple value enum') */ - public function testMultipleValueEnum() + public function testMultipleValueEnum() : void { $body = ' enum Hello { @@ -385,7 +385,7 @@ type Query { /** * @see it('Simple Union') */ - public function testSimpleUnion() + public function testSimpleUnion() : void { $body = ' union Hello = World @@ -405,7 +405,7 @@ type World { /** * @see it('Multiple Union') */ - public function testMultipleUnion() + public function testMultipleUnion() : void { $body = ' union Hello = WorldOne | WorldTwo @@ -429,7 +429,7 @@ type WorldTwo { /** * @see it('Specifying Union type using __typename') */ - public function testSpecifyingUnionTypeUsingTypename() + public function testSpecifyingUnionTypeUsingTypename() : void { $schema = BuildSchema::buildAST(Parser::parse(' type Query { @@ -486,7 +486,7 @@ type WorldTwo { /** * @see it('Specifying Interface type using __typename') */ - public function testSpecifyingInterfaceUsingTypename() + public function testSpecifyingInterfaceUsingTypename() : void { $schema = BuildSchema::buildAST(Parser::parse(' type Query { @@ -550,7 +550,7 @@ type WorldTwo { /** * @see it('Custom Scalar') */ - public function testCustomScalar() + public function testCustomScalar() : void { $body = ' scalar CustomScalar @@ -566,7 +566,7 @@ type Query { /** * @see it('Input Object') */ - public function testInputObject() + public function testInputObject() : void { $body = ' input Input { @@ -584,7 +584,7 @@ type Query { /** * @see it('Simple argument field with default') */ - public function testSimpleArgumentFieldWithDefault() + public function testSimpleArgumentFieldWithDefault() : void { $body = ' type Query { @@ -598,7 +598,7 @@ type Query { /** * @see it('Custom scalar argument field with default') */ - public function testCustomScalarArgumentFieldWithDefault() + public function testCustomScalarArgumentFieldWithDefault() : void { $body = ' scalar CustomScalar @@ -614,7 +614,7 @@ type Query { /** * @see it('Simple type with mutation') */ - public function testSimpleTypeWithMutation() + public function testSimpleTypeWithMutation() : void { $body = ' schema { @@ -639,7 +639,7 @@ type Mutation { /** * @see it('Simple type with subscription') */ - public function testSimpleTypeWithSubscription() + public function testSimpleTypeWithSubscription() : void { $body = ' schema { @@ -664,7 +664,7 @@ type Subscription { /** * @see it('Unreferenced type implementing referenced interface') */ - public function testUnreferencedTypeImplementingReferencedInterface() + public function testUnreferencedTypeImplementingReferencedInterface() : void { $body = ' type Concrete implements Iface { @@ -686,7 +686,7 @@ type Query { /** * @see it('Unreferenced type implementing referenced union') */ - public function testUnreferencedTypeImplementingReferencedUnion() + public function testUnreferencedTypeImplementingReferencedUnion() : void { $body = ' type Concrete { @@ -706,7 +706,7 @@ union Union = Concrete /** * @see it('Supports @deprecated') */ - public function testSupportsDeprecated() + public function testSupportsDeprecated() : void { $body = ' enum MyEnum { @@ -752,7 +752,7 @@ type Query { /** * @see it('Correctly assign AST nodes') */ - public function testCorrectlyAssignASTNodes() + public function testCorrectlyAssignASTNodes() : void { $schemaAST = Parser::parse(' schema { @@ -823,7 +823,7 @@ type Query { /** * @see it('Root operation types with custom names') */ - public function testRootOperationTypesWithCustomNames() + public function testRootOperationTypesWithCustomNames() : void { $schema = BuildSchema::build(' schema { @@ -844,7 +844,7 @@ type Query { /** * @see it('Default root operation type names') */ - public function testDefaultRootOperationTypeNames() + public function testDefaultRootOperationTypeNames() : void { $schema = BuildSchema::build(' type Query { str: String } @@ -859,7 +859,7 @@ type Query { /** * @see it('can build invalid schema') */ - public function testCanBuildInvalidSchema() + public function testCanBuildInvalidSchema() : void { $schema = BuildSchema::build(' # Invalid schema, because it is missing query root type @@ -876,7 +876,7 @@ type Query { /** * @see it('Allows only a single schema definition') */ - public function testAllowsOnlySingleSchemaDefinition() + public function testAllowsOnlySingleSchemaDefinition() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Must provide only one schema definition.'); @@ -900,7 +900,7 @@ type Hello { /** * @see it('Allows only a single query type') */ - public function testAllowsOnlySingleQueryType() + public function testAllowsOnlySingleQueryType() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Must provide only one query type in schema.'); @@ -925,7 +925,7 @@ type Yellow { /** * @see it('Allows only a single mutation type') */ - public function testAllowsOnlySingleMutationType() + public function testAllowsOnlySingleMutationType() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Must provide only one mutation type in schema.'); @@ -951,7 +951,7 @@ type Yellow { /** * @see it('Allows only a single subscription type') */ - public function testAllowsOnlySingleSubscriptionType() + public function testAllowsOnlySingleSubscriptionType() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Must provide only one subscription type in schema.'); @@ -977,7 +977,7 @@ type Yellow { /** * @see it('Unknown type referenced') */ - public function testUnknownTypeReferenced() + public function testUnknownTypeReferenced() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Type "Bar" not found in document.'); @@ -998,7 +998,7 @@ type Hello { /** * @see it('Unknown type in interface list') */ - public function testUnknownTypeInInterfaceList() + public function testUnknownTypeInInterfaceList() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Type "Bar" not found in document.'); @@ -1015,7 +1015,7 @@ type Query implements Bar { /** * @see it('Unknown type in union list') */ - public function testUnknownTypeInUnionList() + public function testUnknownTypeInUnionList() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Type "Bar" not found in document.'); @@ -1031,7 +1031,7 @@ type Query { testUnion: TestUnion } /** * @see it('Unknown query type') */ - public function testUnknownQueryType() + public function testUnknownQueryType() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Specified query type "Wat" not found in document.'); @@ -1051,7 +1051,7 @@ type Hello { /** * @see it('Unknown mutation type') */ - public function testUnknownMutationType() + public function testUnknownMutationType() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Specified mutation type "Wat" not found in document.'); @@ -1072,7 +1072,7 @@ type Hello { /** * @see it('Unknown subscription type') */ - public function testUnknownSubscriptionType() + public function testUnknownSubscriptionType() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Specified subscription type "Awesome" not found in document.'); @@ -1098,7 +1098,7 @@ type Wat { /** * @see it('Does not consider operation names') */ - public function testDoesNotConsiderOperationNames() + public function testDoesNotConsiderOperationNames() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Specified query type "Foo" not found in document.'); @@ -1116,7 +1116,7 @@ query Foo { field } /** * @see it('Does not consider fragment names') */ - public function testDoesNotConsiderFragmentNames() + public function testDoesNotConsiderFragmentNames() : void { $this->expectException(Error::class); $this->expectExceptionMessage('Specified query type "Foo" not found in document.'); @@ -1134,7 +1134,7 @@ fragment Foo on Type { field } /** * @see it('Forbids duplicate type definitions') */ - public function testForbidsDuplicateTypeDefinitions() + public function testForbidsDuplicateTypeDefinitions() : void { $body = ' schema { @@ -1156,7 +1156,7 @@ type Repeated { BuildSchema::buildAST($doc); } - public function testSupportsTypeConfigDecorator() + public function testSupportsTypeConfigDecorator() : void { $body = ' schema { @@ -1231,7 +1231,7 @@ interface Hello { $this->assertEquals('My description of Hello', $schema->getType('Hello')->description); } - public function testCreatesTypesLazily() + public function testCreatesTypesLazily() : void { $body = ' schema { diff --git a/tests/Utils/CoerceValueTest.php b/tests/Utils/CoerceValueTest.php index 6ff0e38..0585214 100644 --- a/tests/Utils/CoerceValueTest.php +++ b/tests/Utils/CoerceValueTest.php @@ -39,7 +39,7 @@ class CoerceValueTest extends TestCase /** * @see it('coercing an array to GraphQLString produces an error') */ - public function testCoercingAnArrayToGraphQLStringProducesAnError() + public function testCoercingAnArrayToGraphQLStringProducesAnError() : void { $result = Value::coerceValue([1, 2, 3], Type::string()); $this->expectError( @@ -58,7 +58,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for int input') */ - public function testIntReturnsNoErrorForIntInput() + public function testIntReturnsNoErrorForIntInput() : void { $result = Value::coerceValue('1', Type::int()); $this->expectNoErrors($result); @@ -67,7 +67,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for negative int input') */ - public function testIntReturnsNoErrorForNegativeIntInput() + public function testIntReturnsNoErrorForNegativeIntInput() : void { $result = Value::coerceValue('-1', Type::int()); $this->expectNoErrors($result); @@ -76,7 +76,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for exponent input') */ - public function testIntReturnsNoErrorForExponentInput() + public function testIntReturnsNoErrorForExponentInput() : void { $result = Value::coerceValue('1e3', Type::int()); $this->expectNoErrors($result); @@ -85,7 +85,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for null') */ - public function testIntReturnsASingleErrorNull() + public function testIntReturnsASingleErrorNull() : void { $result = Value::coerceValue(null, Type::int()); $this->expectNoErrors($result); @@ -94,7 +94,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns a single error for empty value') */ - public function testIntReturnsASingleErrorForEmptyValue() + public function testIntReturnsASingleErrorForEmptyValue() : void { $result = Value::coerceValue('', Type::int()); $this->expectError( @@ -106,7 +106,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns error for float input as int') */ - public function testIntReturnsErrorForFloatInputAsInt() + public function testIntReturnsErrorForFloatInputAsInt() : void { $result = Value::coerceValue('1.5', Type::int()); $this->expectError( @@ -118,7 +118,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns a single error for char input') */ - public function testIntReturnsASingleErrorForCharInput() + public function testIntReturnsASingleErrorForCharInput() : void { $result = Value::coerceValue('a', Type::int()); $this->expectError( @@ -130,7 +130,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns a single error for multi char input') */ - public function testIntReturnsASingleErrorForMultiCharInput() + public function testIntReturnsASingleErrorForMultiCharInput() : void { $result = Value::coerceValue('meow', Type::int()); $this->expectError( @@ -144,7 +144,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for int input') */ - public function testFloatReturnsNoErrorForIntInput() + public function testFloatReturnsNoErrorForIntInput() : void { $result = Value::coerceValue('1', Type::float()); $this->expectNoErrors($result); @@ -153,7 +153,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for exponent input') */ - public function testFloatReturnsNoErrorForExponentInput() + public function testFloatReturnsNoErrorForExponentInput() : void { $result = Value::coerceValue('1e3', Type::float()); $this->expectNoErrors($result); @@ -162,7 +162,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for float input') */ - public function testFloatReturnsNoErrorForFloatInput() + public function testFloatReturnsNoErrorForFloatInput() : void { $result = Value::coerceValue('1.5', Type::float()); $this->expectNoErrors($result); @@ -171,7 +171,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for null') */ - public function testFloatReturnsASingleErrorNull() + public function testFloatReturnsASingleErrorNull() : void { $result = Value::coerceValue(null, Type::float()); $this->expectNoErrors($result); @@ -180,7 +180,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns a single error for empty value') */ - public function testFloatReturnsASingleErrorForEmptyValue() + public function testFloatReturnsASingleErrorForEmptyValue() : void { $result = Value::coerceValue('', Type::float()); $this->expectError( @@ -192,7 +192,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns a single error for char input') */ - public function testFloatReturnsASingleErrorForCharInput() + public function testFloatReturnsASingleErrorForCharInput() : void { $result = Value::coerceValue('a', Type::float()); $this->expectError( @@ -204,7 +204,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns a single error for multi char input') */ - public function testFloatReturnsASingleErrorForMultiCharInput() + public function testFloatReturnsASingleErrorForMultiCharInput() : void { $result = Value::coerceValue('meow', Type::float()); $this->expectError( @@ -218,7 +218,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for a known enum name') */ - public function testReturnsNoErrorForAKnownEnumName() + public function testReturnsNoErrorForAKnownEnumName() : void { $fooResult = Value::coerceValue('FOO', $this->testEnum); $this->expectNoErrors($fooResult); @@ -232,7 +232,7 @@ class CoerceValueTest extends TestCase /** * @see it('results error for misspelled enum value') */ - public function testReturnsErrorForMisspelledEnumValue() + public function testReturnsErrorForMisspelledEnumValue() : void { $result = Value::coerceValue('foo', $this->testEnum); $this->expectError($result, 'Expected type TestEnum; did you mean FOO?'); @@ -241,7 +241,7 @@ class CoerceValueTest extends TestCase /** * @see it('results error for incorrect value type') */ - public function testReturnsErrorForIncorrectValueType() + public function testReturnsErrorForIncorrectValueType() : void { $result1 = Value::coerceValue(123, $this->testEnum); $this->expectError($result1, 'Expected type TestEnum.'); @@ -255,7 +255,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for a valid input') */ - public function testReturnsNoErrorForValidInput() + public function testReturnsNoErrorForValidInput() : void { $result = Value::coerceValue(['foo' => 123], $this->testInputObject); $this->expectNoErrors($result); @@ -265,7 +265,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for a non-object type') */ - public function testReturnsErrorForNonObjectType() + public function testReturnsErrorForNonObjectType() : void { $result = Value::coerceValue(123, $this->testInputObject); $this->expectError($result, 'Expected type TestInputObject to be an object.'); @@ -274,7 +274,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns no error for an invalid field') */ - public function testReturnErrorForAnInvalidField() + public function testReturnErrorForAnInvalidField() : void { $result = Value::coerceValue(['foo' => 'abc'], $this->testInputObject); $this->expectError($result, 'Expected type Int at value.foo; Int cannot represent non 32-bit signed integer value: abc'); @@ -283,7 +283,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns multiple errors for multiple invalid fields') */ - public function testReturnsMultipleErrorsForMultipleInvalidFields() + public function testReturnsMultipleErrorsForMultipleInvalidFields() : void { $result = Value::coerceValue(['foo' => 'abc', 'bar' => 'def'], $this->testInputObject); $this->assertEquals([ @@ -295,7 +295,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns error for a missing required field') */ - public function testReturnsErrorForAMissingRequiredField() + public function testReturnsErrorForAMissingRequiredField() : void { $result = Value::coerceValue(['bar' => 123], $this->testInputObject); $this->expectError($result, 'Field value.foo of required type Int! was not provided.'); @@ -304,7 +304,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns error for an unknown field') */ - public function testReturnsErrorForAnUnknownField() + public function testReturnsErrorForAnUnknownField() : void { $result = Value::coerceValue(['foo' => 123, 'unknownField' => 123], $this->testInputObject); $this->expectError($result, 'Field "unknownField" is not defined by type TestInputObject.'); @@ -313,7 +313,7 @@ class CoerceValueTest extends TestCase /** * @see it('returns error for a misspelled field') */ - public function testReturnsErrorForAMisspelledField() + public function testReturnsErrorForAMisspelledField() : void { $result = Value::coerceValue(['foo' => 123, 'bart' => 123], $this->testInputObject); $this->expectError($result, 'Field "bart" is not defined by type TestInputObject; did you mean bar?'); diff --git a/tests/Utils/ExtractTypesTest.php b/tests/Utils/ExtractTypesTest.php index 5e2b093..8818899 100644 --- a/tests/Utils/ExtractTypesTest.php +++ b/tests/Utils/ExtractTypesTest.php @@ -274,7 +274,7 @@ class ExtractTypesTest extends TestCase ]); } - public function testExtractTypesFromQuery() + public function testExtractTypesFromQuery() : void { $expectedTypeMap = [ 'Query' => $this->query, @@ -291,7 +291,7 @@ class ExtractTypesTest extends TestCase $this->assertEquals($expectedTypeMap, $actualTypeMap); } - public function testExtractTypesFromMutation() + public function testExtractTypesFromMutation() : void { $expectedTypeMap = [ 'Mutation' => $this->mutation, @@ -313,7 +313,7 @@ class ExtractTypesTest extends TestCase $this->assertEquals($expectedTypeMap, $actualTypeMap); } - public function testThrowsOnMultipleTypesWithSameName() + public function testThrowsOnMultipleTypesWithSameName() : void { $otherUserType = new ObjectType([ 'name' => 'User', diff --git a/tests/Utils/IsValidLiteralValueTest.php b/tests/Utils/IsValidLiteralValueTest.php index 6ad69b9..9f322e4 100644 --- a/tests/Utils/IsValidLiteralValueTest.php +++ b/tests/Utils/IsValidLiteralValueTest.php @@ -15,7 +15,7 @@ class IsValidLiteralValueTest extends TestCase /** * @see it('Returns no errors for a valid value') */ - public function testReturnsNoErrorsForAValidValue() + public function testReturnsNoErrorsForAValidValue() : void { $this->assertEquals( [], @@ -26,7 +26,7 @@ class IsValidLiteralValueTest extends TestCase /** * @see it('Returns errors for an invalid value') */ - public function testReturnsErrorsForForInvalidValue() + public function testReturnsErrorsForForInvalidValue() : void { $errors = DocumentValidator::isValidLiteralValue(Type::int(), Parser::parseValue('"abc"')); diff --git a/tests/Utils/MixedStoreTest.php b/tests/Utils/MixedStoreTest.php index a5d0054..2addef3 100644 --- a/tests/Utils/MixedStoreTest.php +++ b/tests/Utils/MixedStoreTest.php @@ -35,14 +35,14 @@ class MixedStoreTest extends TestCase ]; } - public function testAcceptsNullKeys() + public function testAcceptsNullKeys() : void { foreach ($this->getPossibleValues() as $value) { $this->assertAcceptsKeyValue(null, $value); } } - public function testAcceptsBoolKeys() + public function testAcceptsBoolKeys() : void { foreach ($this->getPossibleValues() as $value) { $this->assertAcceptsKeyValue(false, $value); @@ -52,7 +52,7 @@ class MixedStoreTest extends TestCase } } - public function testAcceptsIntKeys() + public function testAcceptsIntKeys() : void { foreach ($this->getPossibleValues() as $value) { $this->assertAcceptsKeyValue(-100000, $value); @@ -63,7 +63,7 @@ class MixedStoreTest extends TestCase } } - public function testAcceptsFloatKeys() + public function testAcceptsFloatKeys() : void { foreach ($this->getPossibleValues() as $value) { $this->assertAcceptsKeyValue(-100000.5, $value); @@ -76,7 +76,7 @@ class MixedStoreTest extends TestCase } } - public function testAcceptsArrayKeys() + public function testAcceptsArrayKeys() : void { foreach ($this->getPossibleValues() as $value) { $this->assertAcceptsKeyValue([], $value); @@ -88,7 +88,7 @@ class MixedStoreTest extends TestCase } } - public function testAcceptsObjectKeys() + public function testAcceptsObjectKeys() : void { foreach ($this->getPossibleValues() as $value) { $this->assertAcceptsKeyValue(new \stdClass(), $value); diff --git a/tests/Utils/QuotedOrListTest.php b/tests/Utils/QuotedOrListTest.php index 6937ad7..4b0c7b1 100644 --- a/tests/Utils/QuotedOrListTest.php +++ b/tests/Utils/QuotedOrListTest.php @@ -14,7 +14,7 @@ class QuotedOrListTest extends TestCase /** * @see it('Does not accept an empty list') */ - public function testResturnsResultsWhenInputIsEmpty() + public function testResturnsResultsWhenInputIsEmpty() : void { $this->expectException(\LogicException::class); Utils::quotedOrList([]); @@ -23,7 +23,7 @@ class QuotedOrListTest extends TestCase /** * @see it('Returns single quoted item') */ - public function testReturnsSingleQuotedItem() + public function testReturnsSingleQuotedItem() : void { $this->assertEquals( '"A"', @@ -34,7 +34,7 @@ class QuotedOrListTest extends TestCase /** * @see it('Returns two item list') */ - public function testReturnsTwoItemList() + public function testReturnsTwoItemList() : void { $this->assertEquals( '"A" or "B"', @@ -45,7 +45,7 @@ class QuotedOrListTest extends TestCase /** * @see it('Returns comma separated many item list') */ - public function testReturnsCommaSeparatedManyItemList() + public function testReturnsCommaSeparatedManyItemList() : void { $this->assertEquals( '"A", "B", or "C"', @@ -56,7 +56,7 @@ class QuotedOrListTest extends TestCase /** * @see it('Limits to five items') */ - public function testLimitsToFiveItems() + public function testLimitsToFiveItems() : void { $this->assertEquals( '"A", "B", "C", "D", or "E"', diff --git a/tests/Utils/SchemaPrinterTest.php b/tests/Utils/SchemaPrinterTest.php index cfd6f51..90caae5 100644 --- a/tests/Utils/SchemaPrinterTest.php +++ b/tests/Utils/SchemaPrinterTest.php @@ -40,7 +40,7 @@ class SchemaPrinterTest extends TestCase /** * @see it('Prints String Field') */ - public function testPrintsStringField() + public function testPrintsStringField() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::string() @@ -55,7 +55,7 @@ type Query { /** * @see it('Prints [String] Field') */ - public function testPrintArrayStringField() + public function testPrintArrayStringField() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::listOf(Type::string()) @@ -70,7 +70,7 @@ type Query { /** * @see it('Prints String! Field') */ - public function testPrintNonNullStringField() + public function testPrintNonNullStringField() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::nonNull(Type::string()) @@ -85,7 +85,7 @@ type Query { /** * @see it('Prints [String]! Field') */ - public function testPrintNonNullArrayStringField() + public function testPrintNonNullArrayStringField() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::nonNull(Type::listOf(Type::string())) @@ -100,7 +100,7 @@ type Query { /** * @see it('Prints [String!] Field') */ - public function testPrintArrayNonNullStringField() + public function testPrintArrayNonNullStringField() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::listOf(Type::nonNull(Type::string())) @@ -115,7 +115,7 @@ type Query { /** * @see it('Prints [String!]! Field') */ - public function testPrintNonNullArrayNonNullStringField() + public function testPrintNonNullArrayNonNullStringField() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::nonNull(Type::listOf(Type::nonNull(Type::string()))) @@ -130,7 +130,7 @@ type Query { /** * @see it('Print Object Field') */ - public function testPrintObjectField() + public function testPrintObjectField() : void { $fooType = new ObjectType([ 'name' => 'Foo', @@ -158,7 +158,7 @@ type Query { /** * @see it('Prints String Field With Int Arg') */ - public function testPrintsStringFieldWithIntArg() + public function testPrintsStringFieldWithIntArg() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::string(), @@ -174,7 +174,7 @@ type Query { /** * @see it('Prints String Field With Int Arg With Default') */ - public function testPrintsStringFieldWithIntArgWithDefault() + public function testPrintsStringFieldWithIntArgWithDefault() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::string(), @@ -190,7 +190,7 @@ type Query { /** * @see it('Prints String Field With String Arg With Default') */ - public function testPrintsStringFieldWithStringArgWithDefault() + public function testPrintsStringFieldWithStringArgWithDefault() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::string(), @@ -206,7 +206,7 @@ type Query { /** * @see it('Prints String Field With Int Arg With Default Null') */ - public function testPrintsStringFieldWithIntArgWithDefaultNull() + public function testPrintsStringFieldWithIntArgWithDefaultNull() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::string(), @@ -222,7 +222,7 @@ type Query { /** * @see it('Prints String Field With Int! Arg') */ - public function testPrintsStringFieldWithNonNullIntArg() + public function testPrintsStringFieldWithNonNullIntArg() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::string(), @@ -238,7 +238,7 @@ type Query { /** * @see it('Prints String Field With Multiple Args') */ - public function testPrintsStringFieldWithMultipleArgs() + public function testPrintsStringFieldWithMultipleArgs() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::string(), @@ -257,7 +257,7 @@ type Query { /** * @see it('Prints String Field With Multiple Args, First is Default') */ - public function testPrintsStringFieldWithMultipleArgsFirstIsDefault() + public function testPrintsStringFieldWithMultipleArgsFirstIsDefault() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::string(), @@ -277,7 +277,7 @@ type Query { /** * @see it('Prints String Field With Multiple Args, Second is Default') */ - public function testPrintsStringFieldWithMultipleArgsSecondIsDefault() + public function testPrintsStringFieldWithMultipleArgsSecondIsDefault() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::string(), @@ -297,7 +297,7 @@ type Query { /** * @see it('Prints String Field With Multiple Args, Last is Default') */ - public function testPrintsStringFieldWithMultipleArgsLastIsDefault() + public function testPrintsStringFieldWithMultipleArgsLastIsDefault() : void { $output = $this->printSingleFieldSchema([ 'type' => Type::string(), @@ -317,7 +317,7 @@ type Query { /** * @see it('Prints custom query root type') */ - public function testPrintsCustomQueryRootType() + public function testPrintsCustomQueryRootType() : void { $customQueryType = new ObjectType([ 'name' => 'CustomQueryType', @@ -343,7 +343,7 @@ type CustomQueryType { /** * @see it('Print Interface') */ - public function testPrintInterface() + public function testPrintInterface() : void { $fooType = new InterfaceType([ 'name' => 'Foo', @@ -384,7 +384,7 @@ type Query { /** * @see it('Print Multiple Interface') */ - public function testPrintMultipleInterface() + public function testPrintMultipleInterface() : void { $fooType = new InterfaceType([ 'name' => 'Foo', @@ -438,7 +438,7 @@ type Query { /** * @see it('Print Unions') */ - public function testPrintUnions() + public function testPrintUnions() : void { $fooType = new ObjectType([ 'name' => 'Foo', @@ -493,7 +493,7 @@ union SingleUnion = Foo /** * @see it('Print Input Type') */ - public function testInputType() + public function testInputType() : void { $inputType = new InputObjectType([ 'name' => 'InputType', @@ -526,7 +526,7 @@ type Query { /** * @see it('Custom Scalar') */ - public function testCustomScalar() + public function testCustomScalar() : void { $oddType = new CustomScalarType([ 'name' => 'Odd', @@ -556,7 +556,7 @@ type Query { /** * @see it('Enum') */ - public function testEnum() + public function testEnum() : void { $RGBType = new EnumType([ 'name' => 'RGB', @@ -592,7 +592,7 @@ enum RGB { /** * @see it('Prints custom directives') */ - public function testPrintsCustomDirectives() + public function testPrintsCustomDirectives() : void { $query = new ObjectType([ 'name' => 'Query', @@ -626,7 +626,7 @@ type Query { /** * @see it('One-line prints a short description') */ - public function testOneLinePrintsAShortDescription() + public function testOneLinePrintsAShortDescription() : void { $description = 'This field is awesome'; $output = $this->printSingleFieldSchema([ @@ -649,7 +649,7 @@ type Query { /** * @see it('Does not one-line print a description that ends with a quote') */ - public function testDoesNotOneLinePrintADescriptionThatEndsWithAQuote() + public function testDoesNotOneLinePrintADescriptionThatEndsWithAQuote() : void { $description = 'This field is "awesome"'; $output = $this->printSingleFieldSchema([ @@ -674,7 +674,7 @@ type Query { /** * @see it('Preserves leading spaces when printing a description') */ - public function testPReservesLeadingSpacesWhenPrintingADescription() + public function testPReservesLeadingSpacesWhenPrintingADescription() : void { $description = ' This field is "awesome"'; $output = $this->printSingleFieldSchema([ @@ -698,7 +698,7 @@ type Query { /** * @see it('Print Introspection Schema') */ - public function testPrintIntrospectionSchema() + public function testPrintIntrospectionSchema() : void { $query = new ObjectType([ 'name' => 'Query', @@ -943,7 +943,7 @@ EOT; /** * @see it('Print Introspection Schema with comment descriptions') */ - public function testPrintIntrospectionSchemaWithCommentDescriptions() + public function testPrintIntrospectionSchemaWithCommentDescriptions() : void { $query = new ObjectType([ 'name' => 'Query', diff --git a/tests/Utils/SuggestionListTest.php b/tests/Utils/SuggestionListTest.php index 18205e9..dcb152f 100644 --- a/tests/Utils/SuggestionListTest.php +++ b/tests/Utils/SuggestionListTest.php @@ -14,7 +14,7 @@ class SuggestionListTest extends TestCase /** * @see it('Returns results when input is empty') */ - public function testResturnsResultsWhenInputIsEmpty() + public function testResturnsResultsWhenInputIsEmpty() : void { $this->assertEquals( Utils::suggestionList('', ['a']), @@ -25,7 +25,7 @@ class SuggestionListTest extends TestCase /** * @see it('Returns empty array when there are no options') */ - public function testReturnsEmptyArrayWhenThereAreNoOptions() + public function testReturnsEmptyArrayWhenThereAreNoOptions() : void { $this->assertEquals( Utils::suggestionList('input', []), @@ -36,7 +36,7 @@ class SuggestionListTest extends TestCase /** * @see it('Returns options sorted based on similarity') */ - public function testReturnsOptionsSortedBasedOnSimilarity() + public function testReturnsOptionsSortedBasedOnSimilarity() : void { $this->assertEquals( Utils::suggestionList('abc', ['a', 'ab', 'abc']), diff --git a/tests/Utils/ValueFromAstTest.php b/tests/Utils/ValueFromAstTest.php index 3e54576..a9dfca9 100644 --- a/tests/Utils/ValueFromAstTest.php +++ b/tests/Utils/ValueFromAstTest.php @@ -25,7 +25,7 @@ class ValueFromAstTest extends TestCase /** * @see it('rejects empty input') */ - public function testRejectsEmptyInput() + public function testRejectsEmptyInput() : void { $this->assertEquals(Utils::undefined(), AST::valueFromAST(null, Type::boolean())); } @@ -33,7 +33,7 @@ class ValueFromAstTest extends TestCase /** * @see it('converts according to input coercion rules') */ - public function testConvertsAccordingToInputCoercionRules() + public function testConvertsAccordingToInputCoercionRules() : void { $this->runTestCase(Type::boolean(), 'true', true); $this->runTestCase(Type::boolean(), 'false', false); @@ -48,7 +48,7 @@ class ValueFromAstTest extends TestCase /** * @see it('does not convert when input coercion rules reject a value') */ - public function testDoesNotConvertWhenInputCoercionRulesRejectAValue() + public function testDoesNotConvertWhenInputCoercionRulesRejectAValue() : void { $undefined = Utils::undefined(); @@ -65,7 +65,7 @@ class ValueFromAstTest extends TestCase /** * @see it('converts enum values according to input coercion rules') */ - public function testConvertsEnumValuesAccordingToInputCoercionRules() + public function testConvertsEnumValuesAccordingToInputCoercionRules() : void { $testEnum = new EnumType([ 'name' => 'TestColor', @@ -88,7 +88,7 @@ class ValueFromAstTest extends TestCase /** * @see it('coerces to null unless non-null') */ - public function testCoercesToNullUnlessNonNull() + public function testCoercesToNullUnlessNonNull() : void { $this->runTestCase(Type::boolean(), 'null', null); $this->runTestCase(Type::nonNull(Type::boolean()), 'null', Utils::undefined()); @@ -97,7 +97,7 @@ class ValueFromAstTest extends TestCase /** * @see it('coerces lists of values') */ - public function testCoercesListsOfValues() + public function testCoercesListsOfValues() : void { $listOfBool = Type::listOf(Type::boolean()); $undefined = Utils::undefined(); @@ -114,7 +114,7 @@ class ValueFromAstTest extends TestCase /** * @see it('coerces non-null lists of values') */ - public function testCoercesNonNullListsOfValues() + public function testCoercesNonNullListsOfValues() : void { $nonNullListOfBool = Type::nonNull(Type::listOf(Type::boolean())); $undefined = Utils::undefined(); @@ -130,7 +130,7 @@ class ValueFromAstTest extends TestCase /** * @see it('coerces lists of non-null values') */ - public function testCoercesListsOfNonNullValues() + public function testCoercesListsOfNonNullValues() : void { $listOfNonNullBool = Type::listOf(Type::nonNull(Type::boolean())); $undefined = Utils::undefined(); @@ -146,7 +146,7 @@ class ValueFromAstTest extends TestCase /** * @see it('coerces non-null lists of non-null values') */ - public function testCoercesNonNullListsOfNonNullValues() + public function testCoercesNonNullListsOfNonNullValues() : void { $nonNullListOfNonNullBool = Type::nonNull(Type::listOf(Type::nonNull(Type::boolean()))); $undefined = Utils::undefined(); @@ -176,7 +176,7 @@ class ValueFromAstTest extends TestCase /** * @see it('coerces input objects according to input coercion rules') */ - public function testCoercesInputObjectsAccordingToInputCoercionRules() + public function testCoercesInputObjectsAccordingToInputCoercionRules() : void { $testInputObj = $this->inputObj(); $undefined = Utils::undefined(); @@ -194,7 +194,7 @@ class ValueFromAstTest extends TestCase /** * @see it('accepts variable values assuming already coerced') */ - public function testAcceptsVariableValuesAssumingAlreadyCoerced() + public function testAcceptsVariableValuesAssumingAlreadyCoerced() : void { $this->runTestCaseWithVars([], Type::boolean(), '$var', Utils::undefined()); $this->runTestCaseWithVars([ 'var' => true ], Type::boolean(), '$var', true); @@ -204,7 +204,7 @@ class ValueFromAstTest extends TestCase /** * @see it('asserts variables are provided as items in lists') */ - public function testAssertsVariablesAreProvidedAsItemsInLists() + public function testAssertsVariablesAreProvidedAsItemsInLists() : void { $listOfBool = Type::listOf(Type::boolean()); $listOfNonNullBool = Type::listOf(Type::nonNull(Type::boolean())); @@ -221,7 +221,7 @@ class ValueFromAstTest extends TestCase /** * @see it('omits input object fields for unprovided variables') */ - public function testOmitsInputObjectFieldsForUnprovidedVariables() + public function testOmitsInputObjectFieldsForUnprovidedVariables() : void { $testInputObj = $this->inputObj(); diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index 84b5e03..facc85b 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -6,7 +6,7 @@ use PHPUnit\Framework\TestCase; class UtilsTest extends TestCase { - public function testAssignThrowsExceptionOnMissingRequiredKey() + public function testAssignThrowsExceptionOnMissingRequiredKey() : void { $object = new \stdClass(); $object->requiredKey = 'value'; diff --git a/tests/Validator/DisableIntrospectionTest.php b/tests/Validator/DisableIntrospectionTest.php index 6bb394d..461daae 100644 --- a/tests/Validator/DisableIntrospectionTest.php +++ b/tests/Validator/DisableIntrospectionTest.php @@ -12,7 +12,7 @@ class DisableIntrospectionTest extends ValidatorTestCase /** * @see it('fails if the query contains __schema') */ - public function testQueryContainsSchema() + public function testQueryContainsSchema() : void { $this->expectFailsRule(new DisableIntrospection(DisableIntrospection::ENABLED), ' query { @@ -30,7 +30,7 @@ class DisableIntrospectionTest extends ValidatorTestCase /** * @see it('fails if the query contains __type') */ - public function testQueryContainsType() + public function testQueryContainsType() : void { $this->expectFailsRule(new DisableIntrospection(DisableIntrospection::ENABLED), ' query { @@ -48,7 +48,7 @@ class DisableIntrospectionTest extends ValidatorTestCase /** * @see it('does not fail on a query that does not contain __type') */ - public function testValidQuery() + public function testValidQuery() : void { $this->expectPassesRule(new DisableIntrospection(DisableIntrospection::ENABLED), ' query { @@ -66,7 +66,7 @@ class DisableIntrospectionTest extends ValidatorTestCase /** * @see it('does not fail when not enabled') */ - public function testQueryWhenDisabled() + public function testQueryWhenDisabled() : void { $this->expectPassesRule(new DisableIntrospection(DisableIntrospection::DISABLED), ' query { @@ -82,7 +82,7 @@ class DisableIntrospectionTest extends ValidatorTestCase /** * @see it('has a public interface for enabeling the rule') */ - public function testPublicEnableInterface() + public function testPublicEnableInterface() : void { $disableIntrospection = new DisableIntrospection(DisableIntrospection::DISABLED); $disableIntrospection->setEnabled(DisableIntrospection::ENABLED); @@ -102,7 +102,7 @@ class DisableIntrospectionTest extends ValidatorTestCase /** * @see it('has a public interface for disableing the rule') */ - public function testPublicDisableInterface() + public function testPublicDisableInterface() : void { $disableIntrospection = new DisableIntrospection(DisableIntrospection::ENABLED); $disableIntrospection->setEnabled(DisableIntrospection::DISABLED); diff --git a/tests/Validator/ExecutableDefinitionsTest.php b/tests/Validator/ExecutableDefinitionsTest.php index a12ff2f..28ab13a 100644 --- a/tests/Validator/ExecutableDefinitionsTest.php +++ b/tests/Validator/ExecutableDefinitionsTest.php @@ -13,7 +13,7 @@ class ExecutableDefinitionsTest extends ValidatorTestCase /** * @see it('with only operation') */ - public function testWithOnlyOperation() + public function testWithOnlyOperation() : void { $this->expectPassesRule(new ExecutableDefinitions, ' query Foo { @@ -27,7 +27,7 @@ class ExecutableDefinitionsTest extends ValidatorTestCase /** * @see it('with operation and fragment') */ - public function testWithOperationAndFragment() + public function testWithOperationAndFragment() : void { $this->expectPassesRule(new ExecutableDefinitions, ' query Foo { @@ -46,7 +46,7 @@ class ExecutableDefinitionsTest extends ValidatorTestCase /** * @see it('with typeDefinition') */ - public function testWithTypeDefinition() + public function testWithTypeDefinition() : void { $this->expectFailsRule(new ExecutableDefinitions, ' query Foo { diff --git a/tests/Validator/FieldsOnCorrectTypeTest.php b/tests/Validator/FieldsOnCorrectTypeTest.php index 4f55b1c..a838f3c 100644 --- a/tests/Validator/FieldsOnCorrectTypeTest.php +++ b/tests/Validator/FieldsOnCorrectTypeTest.php @@ -12,7 +12,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Object field selection') */ - public function testObjectFieldSelection() + public function testObjectFieldSelection() : void { $this->expectPassesRule(new FieldsOnCorrectType(), ' fragment objectFieldSelection on Dog { @@ -25,7 +25,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Aliased object field selection') */ - public function testAliasedObjectFieldSelection() + public function testAliasedObjectFieldSelection() : void { $this->expectPassesRule(new FieldsOnCorrectType, ' fragment aliasedObjectFieldSelection on Dog { @@ -38,7 +38,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Interface field selection') */ - public function testInterfaceFieldSelection() + public function testInterfaceFieldSelection() : void { $this->expectPassesRule(new FieldsOnCorrectType, ' fragment interfaceFieldSelection on Pet { @@ -51,7 +51,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Aliased interface field selection') */ - public function testAliasedInterfaceFieldSelection() + public function testAliasedInterfaceFieldSelection() : void { $this->expectPassesRule(new FieldsOnCorrectType, ' fragment interfaceFieldSelection on Pet { @@ -63,7 +63,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Lying alias selection') */ - public function testLyingAliasSelection() + public function testLyingAliasSelection() : void { $this->expectPassesRule(new FieldsOnCorrectType, ' fragment lyingAliasSelection on Dog { @@ -75,7 +75,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Ignores fields on unknown type') */ - public function testIgnoresFieldsOnUnknownType() + public function testIgnoresFieldsOnUnknownType() : void { $this->expectPassesRule(new FieldsOnCorrectType, ' fragment unknownSelection on UnknownType { @@ -87,7 +87,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('reports errors when type is known again') */ - public function testReportsErrorsWhenTypeIsKnownAgain() + public function testReportsErrorsWhenTypeIsKnownAgain() : void { $this->expectFailsRule(new FieldsOnCorrectType, ' fragment typeKnownAgain on Pet { @@ -107,7 +107,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Field not defined on fragment') */ - public function testFieldNotDefinedOnFragment() + public function testFieldNotDefinedOnFragment() : void { $this->expectFailsRule(new FieldsOnCorrectType, ' fragment fieldNotDefined on Dog { @@ -120,7 +120,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Ignores deeply unknown field') */ - public function testIgnoresDeeplyUnknownField() + public function testIgnoresDeeplyUnknownField() : void { $this->expectFailsRule(new FieldsOnCorrectType, ' fragment deepFieldNotDefined on Dog { @@ -135,7 +135,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Sub-field not defined') */ - public function testSubFieldNotDefined() + public function testSubFieldNotDefined() : void { $this->expectFailsRule(new FieldsOnCorrectType, ' fragment subFieldNotDefined on Human { @@ -150,7 +150,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Field not defined on inline fragment') */ - public function testFieldNotDefinedOnInlineFragment() + public function testFieldNotDefinedOnInlineFragment() : void { $this->expectFailsRule(new FieldsOnCorrectType, ' fragment fieldNotDefined on Pet { @@ -165,7 +165,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Aliased field target not defined') */ - public function testAliasedFieldTargetNotDefined() + public function testAliasedFieldTargetNotDefined() : void { $this->expectFailsRule(new FieldsOnCorrectType, ' fragment aliasedFieldTargetNotDefined on Dog { @@ -178,7 +178,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Aliased lying field target not defined') */ - public function testAliasedLyingFieldTargetNotDefined() + public function testAliasedLyingFieldTargetNotDefined() : void { $this->expectFailsRule(new FieldsOnCorrectType, ' fragment aliasedLyingFieldTargetNotDefined on Dog { @@ -191,7 +191,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Not defined on interface') */ - public function testNotDefinedOnInterface() + public function testNotDefinedOnInterface() : void { $this->expectFailsRule(new FieldsOnCorrectType, ' fragment notDefinedOnInterface on Pet { @@ -204,7 +204,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Defined on implementors but not on interface') */ - public function testDefinedOnImplmentorsButNotOnInterface() + public function testDefinedOnImplmentorsButNotOnInterface() : void { $this->expectFailsRule(new FieldsOnCorrectType, ' fragment definedOnImplementorsButNotInterface on Pet { @@ -217,7 +217,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Meta field selection on union') */ - public function testMetaFieldSelectionOnUnion() + public function testMetaFieldSelectionOnUnion() : void { $this->expectPassesRule(new FieldsOnCorrectType, ' fragment directFieldSelectionOnUnion on CatOrDog { @@ -229,7 +229,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Direct field selection on union') */ - public function testDirectFieldSelectionOnUnion() + public function testDirectFieldSelectionOnUnion() : void { $this->expectFailsRule(new FieldsOnCorrectType, ' fragment directFieldSelectionOnUnion on CatOrDog { @@ -242,7 +242,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Defined on implementors queried on union') */ - public function testDefinedOnImplementorsQueriedOnUnion() + public function testDefinedOnImplementorsQueriedOnUnion() : void { $this->expectFailsRule(new FieldsOnCorrectType, ' fragment definedOnImplementorsQueriedOnUnion on CatOrDog { @@ -262,7 +262,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('valid field in inline fragment') */ - public function testValidFieldInInlineFragment() + public function testValidFieldInInlineFragment() : void { $this->expectPassesRule(new FieldsOnCorrectType, ' fragment objectFieldSelection on Pet { @@ -278,7 +278,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Works with no suggestions') */ - public function testWorksWithNoSuggestions() + public function testWorksWithNoSuggestions() : void { $this->assertEquals('Cannot query field "f" on type "T".', FieldsOnCorrectType::undefinedFieldMessage('f', 'T', [], [])); } @@ -286,7 +286,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Works with no small numbers of type suggestions') */ - public function testWorksWithNoSmallNumbersOfTypeSuggestions() + public function testWorksWithNoSmallNumbersOfTypeSuggestions() : void { $expected = 'Cannot query field "f" on type "T". ' . 'Did you mean to use an inline fragment on "A" or "B"?'; @@ -297,7 +297,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Works with no small numbers of field suggestions') */ - public function testWorksWithNoSmallNumbersOfFieldSuggestions() + public function testWorksWithNoSmallNumbersOfFieldSuggestions() : void { $expected = 'Cannot query field "f" on type "T". ' . 'Did you mean "z" or "y"?'; @@ -308,7 +308,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Only shows one set of suggestions at a time, preferring types') */ - public function testOnlyShowsOneSetOfSuggestionsAtATimePreferringTypes() + public function testOnlyShowsOneSetOfSuggestionsAtATimePreferringTypes() : void { $expected = 'Cannot query field "f" on type "T". ' . 'Did you mean to use an inline fragment on "A" or "B"?'; @@ -319,7 +319,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Limits lots of type suggestions') */ - public function testLimitsLotsOfTypeSuggestions() + public function testLimitsLotsOfTypeSuggestions() : void { $expected = 'Cannot query field "f" on type "T". ' . 'Did you mean to use an inline fragment on "A", "B", "C", "D", or "E"?'; @@ -335,7 +335,7 @@ class FieldsOnCorrectTypeTest extends ValidatorTestCase /** * @see it('Limits lots of field suggestions') */ - public function testLimitsLotsOfFieldSuggestions() + public function testLimitsLotsOfFieldSuggestions() : void { $expected = 'Cannot query field "f" on type "T". ' . 'Did you mean "z", "y", "x", "w", or "v"?'; diff --git a/tests/Validator/FragmentsOnCompositeTypesTest.php b/tests/Validator/FragmentsOnCompositeTypesTest.php index c8a0f0a..b1a116a 100644 --- a/tests/Validator/FragmentsOnCompositeTypesTest.php +++ b/tests/Validator/FragmentsOnCompositeTypesTest.php @@ -12,7 +12,7 @@ class FragmentsOnCompositeTypesTest extends ValidatorTestCase /** * @see it('object is valid fragment type') */ - public function testObjectIsValidFragmentType() + public function testObjectIsValidFragmentType() : void { $this->expectPassesRule(new FragmentsOnCompositeTypes, ' fragment validFragment on Dog { @@ -24,7 +24,7 @@ class FragmentsOnCompositeTypesTest extends ValidatorTestCase /** * @see it('interface is valid fragment type') */ - public function testInterfaceIsValidFragmentType() + public function testInterfaceIsValidFragmentType() : void { $this->expectPassesRule(new FragmentsOnCompositeTypes, ' fragment validFragment on Pet { @@ -36,7 +36,7 @@ class FragmentsOnCompositeTypesTest extends ValidatorTestCase /** * @see it('object is valid inline fragment type') */ - public function testObjectIsValidInlineFragmentType() + public function testObjectIsValidInlineFragmentType() : void { $this->expectPassesRule(new FragmentsOnCompositeTypes, ' fragment validFragment on Pet { @@ -50,7 +50,7 @@ class FragmentsOnCompositeTypesTest extends ValidatorTestCase /** * @see it('inline fragment without type is valid') */ - public function testInlineFragmentWithoutTypeIsValid() + public function testInlineFragmentWithoutTypeIsValid() : void { $this->expectPassesRule(new FragmentsOnCompositeTypes, ' fragment validFragment on Pet { @@ -64,7 +64,7 @@ class FragmentsOnCompositeTypesTest extends ValidatorTestCase /** * @see it('union is valid fragment type') */ - public function testUnionIsValidFragmentType() + public function testUnionIsValidFragmentType() : void { $this->expectPassesRule(new FragmentsOnCompositeTypes, ' fragment validFragment on CatOrDog { @@ -76,7 +76,7 @@ class FragmentsOnCompositeTypesTest extends ValidatorTestCase /** * @see it('scalar is invalid fragment type') */ - public function testScalarIsInvalidFragmentType() + public function testScalarIsInvalidFragmentType() : void { $this->expectFailsRule(new FragmentsOnCompositeTypes, ' fragment scalarFragment on Boolean { @@ -89,7 +89,7 @@ class FragmentsOnCompositeTypesTest extends ValidatorTestCase /** * @see it('enum is invalid fragment type') */ - public function testEnumIsInvalidFragmentType() + public function testEnumIsInvalidFragmentType() : void { $this->expectFailsRule(new FragmentsOnCompositeTypes, ' fragment scalarFragment on FurColor { @@ -102,7 +102,7 @@ class FragmentsOnCompositeTypesTest extends ValidatorTestCase /** * @see it('input object is invalid fragment type') */ - public function testInputObjectIsInvalidFragmentType() + public function testInputObjectIsInvalidFragmentType() : void { $this->expectFailsRule(new FragmentsOnCompositeTypes, ' fragment inputFragment on ComplexInput { @@ -115,7 +115,7 @@ class FragmentsOnCompositeTypesTest extends ValidatorTestCase /** * @see it('scalar is invalid inline fragment type') */ - public function testScalarIsInvalidInlineFragmentType() + public function testScalarIsInvalidInlineFragmentType() : void { $this->expectFailsRule(new FragmentsOnCompositeTypes, ' fragment invalidFragment on Pet { diff --git a/tests/Validator/KnownArgumentNamesTest.php b/tests/Validator/KnownArgumentNamesTest.php index eeba12e..8c3fc24 100644 --- a/tests/Validator/KnownArgumentNamesTest.php +++ b/tests/Validator/KnownArgumentNamesTest.php @@ -12,7 +12,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('single arg is known') */ - public function testSingleArgIsKnown() + public function testSingleArgIsKnown() : void { $this->expectPassesRule(new KnownArgumentNames, ' fragment argOnRequiredArg on Dog { @@ -24,7 +24,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('multiple args are known') */ - public function testMultipleArgsAreKnown() + public function testMultipleArgsAreKnown() : void { $this->expectPassesRule(new KnownArgumentNames, ' fragment multipleArgs on ComplicatedArgs { @@ -36,7 +36,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('ignores args of unknown fields') */ - public function testIgnoresArgsOfUnknownFields() + public function testIgnoresArgsOfUnknownFields() : void { $this->expectPassesRule(new KnownArgumentNames, ' fragment argOnUnknownField on Dog { @@ -48,7 +48,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('multiple args in reverse order are known') */ - public function testMultipleArgsInReverseOrderAreKnown() + public function testMultipleArgsInReverseOrderAreKnown() : void { $this->expectPassesRule(new KnownArgumentNames, ' fragment multipleArgsReverseOrder on ComplicatedArgs { @@ -60,7 +60,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('no args on optional arg') */ - public function testNoArgsOnOptionalArg() + public function testNoArgsOnOptionalArg() : void { $this->expectPassesRule(new KnownArgumentNames, ' fragment noArgOnOptionalArg on Dog { @@ -72,7 +72,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('args are known deeply') */ - public function testArgsAreKnownDeeply() + public function testArgsAreKnownDeeply() : void { $this->expectPassesRule(new KnownArgumentNames, ' { @@ -93,7 +93,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('directive args are known') */ - public function testDirectiveArgsAreKnown() + public function testDirectiveArgsAreKnown() : void { $this->expectPassesRule(new KnownArgumentNames, ' { @@ -105,7 +105,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('undirective args are invalid') */ - public function testUndirectiveArgsAreInvalid() + public function testUndirectiveArgsAreInvalid() : void { $this->expectFailsRule(new KnownArgumentNames, ' { @@ -119,7 +119,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('misspelled directive args are reported') */ - public function testMisspelledDirectiveArgsAreReported() + public function testMisspelledDirectiveArgsAreReported() : void { $this->expectFailsRule(new KnownArgumentNames, ' { @@ -133,7 +133,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('invalid arg name') */ - public function testInvalidArgName() + public function testInvalidArgName() : void { $this->expectFailsRule(new KnownArgumentNames, ' fragment invalidArgName on Dog { @@ -147,7 +147,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('misspelled arg name is reported') */ - public function testMisspelledArgNameIsReported() + public function testMisspelledArgNameIsReported() : void { $this->expectFailsRule(new KnownArgumentNames, ' fragment invalidArgName on Dog { @@ -161,7 +161,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('unknown args amongst known args') */ - public function testUnknownArgsAmongstKnownArgs() + public function testUnknownArgsAmongstKnownArgs() : void { $this->expectFailsRule(new KnownArgumentNames, ' fragment oneGoodArgOneInvalidArg on Dog { @@ -176,7 +176,7 @@ class KnownArgumentNamesTest extends ValidatorTestCase /** * @see it('unknown args deeply') */ - public function testUnknownArgsDeeply() + public function testUnknownArgsDeeply() : void { $this->expectFailsRule(new KnownArgumentNames, ' { diff --git a/tests/Validator/KnownDirectivesTest.php b/tests/Validator/KnownDirectivesTest.php index 5347ec7..7f9fd39 100644 --- a/tests/Validator/KnownDirectivesTest.php +++ b/tests/Validator/KnownDirectivesTest.php @@ -12,7 +12,7 @@ class KnownDirectivesTest extends ValidatorTestCase /** * @see it('with no directives') */ - public function testWithNoDirectives() + public function testWithNoDirectives() : void { $this->expectPassesRule(new KnownDirectives, ' query Foo { @@ -29,7 +29,7 @@ class KnownDirectivesTest extends ValidatorTestCase /** * @see it('with known directives') */ - public function testWithKnownDirectives() + public function testWithKnownDirectives() : void { $this->expectPassesRule(new KnownDirectives, ' { @@ -46,7 +46,7 @@ class KnownDirectivesTest extends ValidatorTestCase /** * @see it('with unknown directive') */ - public function testWithUnknownDirective() + public function testWithUnknownDirective() : void { $this->expectFailsRule(new KnownDirectives, ' { @@ -62,7 +62,7 @@ class KnownDirectivesTest extends ValidatorTestCase /** * @see it('with many unknown directives') */ - public function testWithManyUnknownDirectives() + public function testWithManyUnknownDirectives() : void { $this->expectFailsRule(new KnownDirectives, ' { @@ -86,7 +86,7 @@ class KnownDirectivesTest extends ValidatorTestCase /** * @see it('with well placed directives') */ - public function testWithWellPlacedDirectives() + public function testWithWellPlacedDirectives() : void { $this->expectPassesRule(new KnownDirectives, ' query Foo @onQuery { @@ -105,7 +105,7 @@ class KnownDirectivesTest extends ValidatorTestCase /** * @see it('with misplaced directives') */ - public function testWithMisplacedDirectives() + public function testWithMisplacedDirectives() : void { $this->expectFailsRule(new KnownDirectives, ' query Foo @include(if: true) { @@ -129,7 +129,7 @@ class KnownDirectivesTest extends ValidatorTestCase /** * @see it('with well placed directives') */ - public function testWSLWithWellPlacedDirectives() + public function testWSLWithWellPlacedDirectives() : void { $this->expectPassesRule(new KnownDirectives, ' type MyObj implements MyInterface @onObject { @@ -173,7 +173,7 @@ class KnownDirectivesTest extends ValidatorTestCase /** * @see it('with misplaced directives') */ - public function testWSLWithMisplacedDirectives() + public function testWSLWithMisplacedDirectives() : void { $this->expectFailsRule(new KnownDirectives, ' type MyObj implements MyInterface @onInterface { diff --git a/tests/Validator/KnownFragmentNamesTest.php b/tests/Validator/KnownFragmentNamesTest.php index 65fd24d..5764150 100644 --- a/tests/Validator/KnownFragmentNamesTest.php +++ b/tests/Validator/KnownFragmentNamesTest.php @@ -12,7 +12,7 @@ class KnownFragmentNamesTest extends ValidatorTestCase /** * @see it('known fragment names are valid') */ - public function testKnownFragmentNamesAreValid() + public function testKnownFragmentNamesAreValid() : void { $this->expectPassesRule(new KnownFragmentNames, ' { @@ -39,7 +39,7 @@ class KnownFragmentNamesTest extends ValidatorTestCase /** * @see it('unknown fragment names are invalid') */ - public function testUnknownFragmentNamesAreInvalid() + public function testUnknownFragmentNamesAreInvalid() : void { $this->expectFailsRule(new KnownFragmentNames, ' { diff --git a/tests/Validator/KnownTypeNamesTest.php b/tests/Validator/KnownTypeNamesTest.php index 322a361..9604cb8 100644 --- a/tests/Validator/KnownTypeNamesTest.php +++ b/tests/Validator/KnownTypeNamesTest.php @@ -12,7 +12,7 @@ class KnownTypeNamesTest extends ValidatorTestCase /** * @see it('known type names are valid') */ - public function testKnownTypeNamesAreValid() + public function testKnownTypeNamesAreValid() : void { $this->expectPassesRule(new KnownTypeNames, ' query Foo($var: String, $required: [String!]!) { @@ -29,7 +29,7 @@ class KnownTypeNamesTest extends ValidatorTestCase /** * @see it('unknown type names are invalid') */ - public function testUnknownTypeNamesAreInvalid() + public function testUnknownTypeNamesAreInvalid() : void { $this->expectFailsRule(new KnownTypeNames, ' query Foo($var: JumbledUpLetters) { @@ -51,7 +51,7 @@ class KnownTypeNamesTest extends ValidatorTestCase /** * @see it('ignores type definitions') */ - public function testIgnoresTypeDefinitions() + public function testIgnoresTypeDefinitions() : void { $this->expectFailsRule(new KnownTypeNames, ' type NotInTheSchema { diff --git a/tests/Validator/LoneAnonymousOperationTest.php b/tests/Validator/LoneAnonymousOperationTest.php index e7efb83..e8540c8 100644 --- a/tests/Validator/LoneAnonymousOperationTest.php +++ b/tests/Validator/LoneAnonymousOperationTest.php @@ -12,7 +12,7 @@ class LoneAnonymousOperationTest extends ValidatorTestCase /** * @see it('no operations') */ - public function testNoOperations() + public function testNoOperations() : void { $this->expectPassesRule(new LoneAnonymousOperation, ' fragment fragA on Type { @@ -24,7 +24,7 @@ class LoneAnonymousOperationTest extends ValidatorTestCase /** * @see it('one anon operation') */ - public function testOneAnonOperation() + public function testOneAnonOperation() : void { $this->expectPassesRule(new LoneAnonymousOperation, ' { @@ -36,7 +36,7 @@ class LoneAnonymousOperationTest extends ValidatorTestCase /** * @see it('multiple named operations') */ - public function testMultipleNamedOperations() + public function testMultipleNamedOperations() : void { $this->expectPassesRule(new LoneAnonymousOperation, ' query Foo { @@ -52,7 +52,7 @@ class LoneAnonymousOperationTest extends ValidatorTestCase /** * @see it('anon operation with fragment') */ - public function testAnonOperationWithFragment() + public function testAnonOperationWithFragment() : void { $this->expectPassesRule(new LoneAnonymousOperation, ' { @@ -67,7 +67,7 @@ class LoneAnonymousOperationTest extends ValidatorTestCase /** * @see it('multiple anon operations') */ - public function testMultipleAnonOperations() + public function testMultipleAnonOperations() : void { $this->expectFailsRule(new LoneAnonymousOperation, ' { @@ -85,7 +85,7 @@ class LoneAnonymousOperationTest extends ValidatorTestCase /** * @see it('anon operation with a mutation') */ - public function testAnonOperationWithMutation() + public function testAnonOperationWithMutation() : void { $this->expectFailsRule(new LoneAnonymousOperation, ' { @@ -102,7 +102,7 @@ class LoneAnonymousOperationTest extends ValidatorTestCase /** * @see it('anon operation with a subscription') */ - public function testAnonOperationWithSubscription() + public function testAnonOperationWithSubscription() : void { $this->expectFailsRule(new LoneAnonymousOperation, ' { diff --git a/tests/Validator/NoFragmentCyclesTest.php b/tests/Validator/NoFragmentCyclesTest.php index 1df42fd..a962dc3 100644 --- a/tests/Validator/NoFragmentCyclesTest.php +++ b/tests/Validator/NoFragmentCyclesTest.php @@ -12,7 +12,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('single reference is valid') */ - public function testSingleReferenceIsValid() + public function testSingleReferenceIsValid() : void { $this->expectPassesRule(new NoFragmentCycles(), ' fragment fragA on Dog { ...fragB } @@ -23,7 +23,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('spreading twice is not circular') */ - public function testSpreadingTwiceIsNotCircular() + public function testSpreadingTwiceIsNotCircular() : void { $this->expectPassesRule(new NoFragmentCycles, ' fragment fragA on Dog { ...fragB, ...fragB } @@ -34,7 +34,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('spreading twice indirectly is not circular') */ - public function testSpreadingTwiceIndirectlyIsNotCircular() + public function testSpreadingTwiceIndirectlyIsNotCircular() : void { $this->expectPassesRule(new NoFragmentCycles, ' fragment fragA on Dog { ...fragB, ...fragC } @@ -46,7 +46,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('double spread within abstract types') */ - public function testDoubleSpreadWithinAbstractTypes() + public function testDoubleSpreadWithinAbstractTypes() : void { $this->expectPassesRule(new NoFragmentCycles, ' fragment nameFragment on Pet { @@ -64,7 +64,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('does not false positive on unknown fragment') */ - public function testDoesNotFalsePositiveOnUnknownFragment() + public function testDoesNotFalsePositiveOnUnknownFragment() : void { $this->expectPassesRule(new NoFragmentCycles, ' fragment nameFragment on Pet { @@ -76,7 +76,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('spreading recursively within field fails') */ - public function testSpreadingRecursivelyWithinFieldFails() + public function testSpreadingRecursivelyWithinFieldFails() : void { $this->expectFailsRule(new NoFragmentCycles, ' fragment fragA on Human { relatives { ...fragA } }, @@ -88,7 +88,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('no spreading itself directly') */ - public function testNoSpreadingItselfDirectly() + public function testNoSpreadingItselfDirectly() : void { $this->expectFailsRule(new NoFragmentCycles, ' fragment fragA on Dog { ...fragA } @@ -100,7 +100,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('no spreading itself directly within inline fragment') */ - public function testNoSpreadingItselfDirectlyWithinInlineFragment() + public function testNoSpreadingItselfDirectlyWithinInlineFragment() : void { $this->expectFailsRule(new NoFragmentCycles, ' fragment fragA on Pet { @@ -116,7 +116,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('no spreading itself indirectly') */ - public function testNoSpreadingItselfIndirectly() + public function testNoSpreadingItselfIndirectly() : void { $this->expectFailsRule(new NoFragmentCycles, ' fragment fragA on Dog { ...fragB } @@ -132,7 +132,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('no spreading itself indirectly reports opposite order') */ - public function testNoSpreadingItselfIndirectlyReportsOppositeOrder() + public function testNoSpreadingItselfIndirectlyReportsOppositeOrder() : void { $this->expectFailsRule(new NoFragmentCycles, ' fragment fragB on Dog { ...fragA } @@ -148,7 +148,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('no spreading itself indirectly within inline fragment') */ - public function testNoSpreadingItselfIndirectlyWithinInlineFragment() + public function testNoSpreadingItselfIndirectlyWithinInlineFragment() : void { $this->expectFailsRule(new NoFragmentCycles, ' fragment fragA on Pet { @@ -172,7 +172,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('no spreading itself deeply') */ - public function testNoSpreadingItselfDeeply() + public function testNoSpreadingItselfDeeply() : void { $this->expectFailsRule(new NoFragmentCycles, ' fragment fragA on Dog { ...fragB } @@ -210,7 +210,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('no spreading itself deeply two paths') */ - public function testNoSpreadingItselfDeeplyTwoPaths() + public function testNoSpreadingItselfDeeplyTwoPaths() : void { $this->expectFailsRule(new NoFragmentCycles, ' fragment fragA on Dog { ...fragB, ...fragC } @@ -231,7 +231,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('no spreading itself deeply two paths -- alt traverse order') */ - public function testNoSpreadingItselfDeeplyTwoPathsTraverseOrder() + public function testNoSpreadingItselfDeeplyTwoPathsTraverseOrder() : void { $this->expectFailsRule(new NoFragmentCycles, ' fragment fragA on Dog { ...fragC } @@ -252,7 +252,7 @@ class NoFragmentCyclesTest extends ValidatorTestCase /** * @see it('no spreading itself deeply and immediately') */ - public function testNoSpreadingItselfDeeplyAndImmediately() + public function testNoSpreadingItselfDeeplyAndImmediately() : void { $this->expectFailsRule(new NoFragmentCycles, ' fragment fragA on Dog { ...fragB } diff --git a/tests/Validator/NoUndefinedVariablesTest.php b/tests/Validator/NoUndefinedVariablesTest.php index 4df41c5..b4b56b3 100644 --- a/tests/Validator/NoUndefinedVariablesTest.php +++ b/tests/Validator/NoUndefinedVariablesTest.php @@ -12,7 +12,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('all variables defined') */ - public function testAllVariablesDefined() + public function testAllVariablesDefined() : void { $this->expectPassesRule(new NoUndefinedVariables(), ' query Foo($a: String, $b: String, $c: String) { @@ -24,7 +24,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('all variables deeply defined') */ - public function testAllVariablesDeeplyDefined() + public function testAllVariablesDeeplyDefined() : void { $this->expectPassesRule(new NoUndefinedVariables, ' query Foo($a: String, $b: String, $c: String) { @@ -40,7 +40,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('all variables deeply in inline fragments defined') */ - public function testAllVariablesDeeplyInInlineFragmentsDefined() + public function testAllVariablesDeeplyInInlineFragmentsDefined() : void { $this->expectPassesRule(new NoUndefinedVariables, ' query Foo($a: String, $b: String, $c: String) { @@ -60,7 +60,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('all variables in fragments deeply defined') */ - public function testAllVariablesInFragmentsDeeplyDefined() + public function testAllVariablesInFragmentsDeeplyDefined() : void { $this->expectPassesRule(new NoUndefinedVariables, ' query Foo($a: String, $b: String, $c: String) { @@ -85,7 +85,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('variable within single fragment defined in multiple operations') */ - public function testVariableWithinSingleFragmentDefinedInMultipleOperations() + public function testVariableWithinSingleFragmentDefinedInMultipleOperations() : void { // variable within single fragment defined in multiple operations $this->expectPassesRule(new NoUndefinedVariables, ' @@ -104,7 +104,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('variable within fragments defined in operations') */ - public function testVariableWithinFragmentsDefinedInOperations() + public function testVariableWithinFragmentsDefinedInOperations() : void { $this->expectPassesRule(new NoUndefinedVariables, ' query Foo($a: String) { @@ -125,7 +125,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('variable within recursive fragment defined') */ - public function testVariableWithinRecursiveFragmentDefined() + public function testVariableWithinRecursiveFragmentDefined() : void { $this->expectPassesRule(new NoUndefinedVariables, ' query Foo($a: String) { @@ -142,7 +142,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('variable not defined') */ - public function testVariableNotDefined() + public function testVariableNotDefined() : void { $this->expectFailsRule(new NoUndefinedVariables, ' query Foo($a: String, $b: String, $c: String) { @@ -156,7 +156,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('variable not defined by un-named query') */ - public function testVariableNotDefinedByUnNamedQuery() + public function testVariableNotDefinedByUnNamedQuery() : void { $this->expectFailsRule(new NoUndefinedVariables, ' { @@ -170,7 +170,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('multiple variables not defined') */ - public function testMultipleVariablesNotDefined() + public function testMultipleVariablesNotDefined() : void { $this->expectFailsRule(new NoUndefinedVariables, ' query Foo($b: String) { @@ -185,7 +185,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('variable in fragment not defined by un-named query') */ - public function testVariableInFragmentNotDefinedByUnNamedQuery() + public function testVariableInFragmentNotDefinedByUnNamedQuery() : void { $this->expectFailsRule(new NoUndefinedVariables, ' { @@ -202,7 +202,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('variable in fragment not defined by operation') */ - public function testVariableInFragmentNotDefinedByOperation() + public function testVariableInFragmentNotDefinedByOperation() : void { $this->expectFailsRule(new NoUndefinedVariables, ' query Foo($a: String, $b: String) { @@ -229,7 +229,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('multiple variables in fragments not defined') */ - public function testMultipleVariablesInFragmentsNotDefined() + public function testMultipleVariablesInFragmentsNotDefined() : void { $this->expectFailsRule(new NoUndefinedVariables, ' query Foo($b: String) { @@ -257,7 +257,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('single variable in fragment not defined by multiple operations') */ - public function testSingleVariableInFragmentNotDefinedByMultipleOperations() + public function testSingleVariableInFragmentNotDefinedByMultipleOperations() : void { $this->expectFailsRule(new NoUndefinedVariables, ' query Foo($a: String) { @@ -278,7 +278,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('variables in fragment not defined by multiple operations') */ - public function testVariablesInFragmentNotDefinedByMultipleOperations() + public function testVariablesInFragmentNotDefinedByMultipleOperations() : void { $this->expectFailsRule(new NoUndefinedVariables, ' query Foo($b: String) { @@ -299,7 +299,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('variable in fragment used by other operation') */ - public function testVariableInFragmentUsedByOtherOperation() + public function testVariableInFragmentUsedByOtherOperation() : void { $this->expectFailsRule(new NoUndefinedVariables, ' query Foo($b: String) { @@ -323,7 +323,7 @@ class NoUndefinedVariablesTest extends ValidatorTestCase /** * @see it('multiple undefined variables produce multiple errors') */ - public function testMultipleUndefinedVariablesProduceMultipleErrors() + public function testMultipleUndefinedVariablesProduceMultipleErrors() : void { $this->expectFailsRule(new NoUndefinedVariables, ' query Foo($b: String) { diff --git a/tests/Validator/NoUnusedFragmentsTest.php b/tests/Validator/NoUnusedFragmentsTest.php index d297621..323f915 100644 --- a/tests/Validator/NoUnusedFragmentsTest.php +++ b/tests/Validator/NoUnusedFragmentsTest.php @@ -12,7 +12,7 @@ class NoUnusedFragmentsTest extends ValidatorTestCase /** * @see it('all fragment names are used') */ - public function testAllFragmentNamesAreUsed() + public function testAllFragmentNamesAreUsed() : void { $this->expectPassesRule(new NoUnusedFragments(), ' { @@ -39,7 +39,7 @@ class NoUnusedFragmentsTest extends ValidatorTestCase /** * @see it('all fragment names are used by multiple operations') */ - public function testAllFragmentNamesAreUsedByMultipleOperations() + public function testAllFragmentNamesAreUsedByMultipleOperations() : void { $this->expectPassesRule(new NoUnusedFragments, ' query Foo { @@ -68,7 +68,7 @@ class NoUnusedFragmentsTest extends ValidatorTestCase /** * @see it('contains unknown fragments') */ - public function testContainsUnknownFragments() + public function testContainsUnknownFragments() : void { $this->expectFailsRule(new NoUnusedFragments, ' query Foo { @@ -106,7 +106,7 @@ class NoUnusedFragmentsTest extends ValidatorTestCase /** * @see it('contains unknown fragments with ref cycle') */ - public function testContainsUnknownFragmentsWithRefCycle() + public function testContainsUnknownFragmentsWithRefCycle() : void { $this->expectFailsRule(new NoUnusedFragments, ' query Foo { @@ -146,7 +146,7 @@ class NoUnusedFragmentsTest extends ValidatorTestCase /** * @see it('contains unknown and undef fragments') */ - public function testContainsUnknownAndUndefFragments() + public function testContainsUnknownAndUndefFragments() : void { $this->expectFailsRule(new NoUnusedFragments, ' diff --git a/tests/Validator/NoUnusedVariablesTest.php b/tests/Validator/NoUnusedVariablesTest.php index 9d3b3a9..c261c15 100644 --- a/tests/Validator/NoUnusedVariablesTest.php +++ b/tests/Validator/NoUnusedVariablesTest.php @@ -12,7 +12,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('uses all variables') */ - public function testUsesAllVariables() + public function testUsesAllVariables() : void { $this->expectPassesRule(new NoUnusedVariables(), ' query Foo($a: String, $b: String, $c: String) { @@ -24,7 +24,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('uses all variables deeply') */ - public function testUsesAllVariablesDeeply() + public function testUsesAllVariablesDeeply() : void { $this->expectPassesRule(new NoUnusedVariables, ' query Foo($a: String, $b: String, $c: String) { @@ -40,7 +40,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('uses all variables deeply in inline fragments') */ - public function testUsesAllVariablesDeeplyInInlineFragments() + public function testUsesAllVariablesDeeplyInInlineFragments() : void { $this->expectPassesRule(new NoUnusedVariables, ' query Foo($a: String, $b: String, $c: String) { @@ -60,7 +60,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('uses all variables in fragments') */ - public function testUsesAllVariablesInFragments() + public function testUsesAllVariablesInFragments() : void { $this->expectPassesRule(new NoUnusedVariables, ' query Foo($a: String, $b: String, $c: String) { @@ -85,7 +85,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('variable used by fragment in multiple operations') */ - public function testVariableUsedByFragmentInMultipleOperations() + public function testVariableUsedByFragmentInMultipleOperations() : void { $this->expectPassesRule(new NoUnusedVariables, ' query Foo($a: String) { @@ -106,7 +106,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('variable used by recursive fragment') */ - public function testVariableUsedByRecursiveFragment() + public function testVariableUsedByRecursiveFragment() : void { $this->expectPassesRule(new NoUnusedVariables, ' query Foo($a: String) { @@ -123,7 +123,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('variable not used') */ - public function testVariableNotUsed() + public function testVariableNotUsed() : void { $this->expectFailsRule(new NoUnusedVariables, ' query ($a: String, $b: String, $c: String) { @@ -137,7 +137,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('multiple variables not used') */ - public function testMultipleVariablesNotUsed() + public function testMultipleVariablesNotUsed() : void { $this->expectFailsRule(new NoUnusedVariables, ' query Foo($a: String, $b: String, $c: String) { @@ -152,7 +152,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('variable not used in fragments') */ - public function testVariableNotUsedInFragments() + public function testVariableNotUsedInFragments() : void { $this->expectFailsRule(new NoUnusedVariables, ' query Foo($a: String, $b: String, $c: String) { @@ -179,7 +179,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('multiple variables not used') */ - public function testMultipleVariablesNotUsed2() + public function testMultipleVariablesNotUsed2() : void { $this->expectFailsRule(new NoUnusedVariables, ' query Foo($a: String, $b: String, $c: String) { @@ -207,7 +207,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('variable not used by unreferenced fragment') */ - public function testVariableNotUsedByUnreferencedFragment() + public function testVariableNotUsedByUnreferencedFragment() : void { $this->expectFailsRule(new NoUnusedVariables, ' query Foo($b: String) { @@ -227,7 +227,7 @@ class NoUnusedVariablesTest extends ValidatorTestCase /** * @see it('variable not used by fragment used by other operation') */ - public function testVariableNotUsedByFragmentUsedByOtherOperation() + public function testVariableNotUsedByFragmentUsedByOtherOperation() : void { $this->expectFailsRule(new NoUnusedVariables, ' query Foo($b: String) { diff --git a/tests/Validator/OverlappingFieldsCanBeMergedTest.php b/tests/Validator/OverlappingFieldsCanBeMergedTest.php index df20cf8..2aaed7e 100644 --- a/tests/Validator/OverlappingFieldsCanBeMergedTest.php +++ b/tests/Validator/OverlappingFieldsCanBeMergedTest.php @@ -16,7 +16,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('unique fields') */ - public function testUniqueFields() + public function testUniqueFields() : void { $this->expectPassesRule(new OverlappingFieldsCanBeMerged(), ' fragment uniqueFields on Dog { @@ -29,7 +29,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('identical fields') */ - public function testIdenticalFields() + public function testIdenticalFields() : void { $this->expectPassesRule(new OverlappingFieldsCanBeMerged, ' fragment mergeIdenticalFields on Dog { @@ -42,7 +42,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('identical fields with identical args') */ - public function testIdenticalFieldsWithIdenticalArgs() + public function testIdenticalFieldsWithIdenticalArgs() : void { $this->expectPassesRule(new OverlappingFieldsCanBeMerged, ' fragment mergeIdenticalFieldsWithIdenticalArgs on Dog { @@ -55,7 +55,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('identical fields with identical directives') */ - public function testIdenticalFieldsWithIdenticalDirectives() + public function testIdenticalFieldsWithIdenticalDirectives() : void { $this->expectPassesRule(new OverlappingFieldsCanBeMerged, ' fragment mergeSameFieldsWithSameDirectives on Dog { @@ -68,7 +68,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('different args with different aliases') */ - public function testDifferentArgsWithDifferentAliases() + public function testDifferentArgsWithDifferentAliases() : void { $this->expectPassesRule(new OverlappingFieldsCanBeMerged, ' fragment differentArgsWithDifferentAliases on Dog { @@ -81,7 +81,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('different directives with different aliases') */ - public function testDifferentDirectivesWithDifferentAliases() + public function testDifferentDirectivesWithDifferentAliases() : void { $this->expectPassesRule(new OverlappingFieldsCanBeMerged, ' fragment differentDirectivesWithDifferentAliases on Dog { @@ -94,7 +94,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('different skip/include directives accepted') */ - public function testDifferentSkipIncludeDirectivesAccepted() + public function testDifferentSkipIncludeDirectivesAccepted() : void { // Note: Differing skip/include directives don't create an ambiguous return // value and are acceptable in conditions where differing runtime values @@ -110,7 +110,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('Same aliases with different field targets') */ - public function testSameAliasesWithDifferentFieldTargets() + public function testSameAliasesWithDifferentFieldTargets() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' fragment sameAliasesWithDifferentFieldTargets on Dog { @@ -128,7 +128,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('Same aliases allowed on non-overlapping fields') */ - public function testSameAliasesAllowedOnNonOverlappingFields() + public function testSameAliasesAllowedOnNonOverlappingFields() : void { // This is valid since no object can be both a "Dog" and a "Cat", thus // these fields can never overlap. @@ -147,7 +147,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('Alias masking direct field access') */ - public function testAliasMaskingDirectFieldAccess() + public function testAliasMaskingDirectFieldAccess() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' fragment aliasMaskingDirectFieldAccess on Dog { @@ -165,7 +165,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('different args, second adds an argument') */ - public function testDifferentArgsSecondAddsAnArgument() + public function testDifferentArgsSecondAddsAnArgument() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' fragment conflictingArgs on Dog { @@ -183,7 +183,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('different args, second missing an argument') */ - public function testDifferentArgsSecondMissingAnArgument() + public function testDifferentArgsSecondMissingAnArgument() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' fragment conflictingArgs on Dog { @@ -203,7 +203,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('conflicting args') */ - public function testConflictingArgs() + public function testConflictingArgs() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' fragment conflictingArgs on Dog { @@ -221,7 +221,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('allows different args where no conflict is possible') */ - public function testAllowsDifferentArgsWhereNoConflictIsPossible() + public function testAllowsDifferentArgsWhereNoConflictIsPossible() : void { // This is valid since no object can be both a "Dog" and a "Cat", thus // these fields can never overlap. @@ -240,7 +240,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('encounters conflict in fragments') */ - public function testEncountersConflictInFragments() + public function testEncountersConflictInFragments() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' { @@ -264,7 +264,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('reports each conflict once') */ - public function testReportsEachConflictOnce() + public function testReportsEachConflictOnce() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' { @@ -307,7 +307,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('deep conflict') */ - public function testDeepConflict() + public function testDeepConflict() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' { @@ -334,7 +334,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('deep conflict with multiple issues') */ - public function testDeepConflictWithMultipleIssues() + public function testDeepConflictWithMultipleIssues() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' { @@ -368,7 +368,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('very deep conflict') */ - public function testVeryDeepConflict() + public function testVeryDeepConflict() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' { @@ -401,7 +401,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('reports deep conflict to nearest common ancestor') */ - public function testReportsDeepConflictToNearestCommonAncestor() + public function testReportsDeepConflictToNearestCommonAncestor() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' { @@ -435,7 +435,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('reports deep conflict to nearest common ancestor in fragments') */ - public function testReportsDeepConflictToNearestCommonAncestorInFragments() + public function testReportsDeepConflictToNearestCommonAncestorInFragments() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' { @@ -477,7 +477,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('reports deep conflict in nested fragments') */ - public function testReportsDeepConflictInNestedFragments() + public function testReportsDeepConflictInNestedFragments() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' { @@ -523,7 +523,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('ignores unknown fragments') */ - public function testIgnoresUnknownFragments() + public function testIgnoresUnknownFragments() : void { $this->expectPassesRule(new OverlappingFieldsCanBeMerged, ' { @@ -544,7 +544,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('conflicting return types which potentially overlap') */ - public function testConflictingReturnTypesWhichPotentiallyOverlap() + public function testConflictingReturnTypesWhichPotentiallyOverlap() : void { // This is invalid since an object could potentially be both the Object // type IntBox and the interface type NonNullStringBox1. While that @@ -576,7 +576,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('compatible return shapes on different return types') */ - public function testCompatibleReturnShapesOnDifferentReturnTypes() + public function testCompatibleReturnShapesOnDifferentReturnTypes() : void { // In this case `deepBox` returns `SomeBox` in the first usage, and // `StringBox` in the second usage. These return types are not the same! @@ -602,7 +602,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('disallows differing return types despite no overlap') */ - public function testDisallowsDifferingReturnTypesDespiteNoOverlap() + public function testDisallowsDifferingReturnTypesDespiteNoOverlap() : void { $this->expectFailsRuleWithSchema($this->getSchema(), new OverlappingFieldsCanBeMerged, ' { @@ -630,7 +630,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('reports correctly when a non-exclusive follows an exclusive') */ - public function testReportsCorrectlyWhenANonExclusiveFollowsAnExclusive() + public function testReportsCorrectlyWhenANonExclusiveFollowsAnExclusive() : void { $this->expectFailsRuleWithSchema($this->getSchema(), new OverlappingFieldsCanBeMerged, ' { @@ -694,7 +694,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('disallows differing return type nullability despite no overlap') */ - public function testDisallowsDifferingReturnTypeNullabilityDespiteNoOverlap() + public function testDisallowsDifferingReturnTypeNullabilityDespiteNoOverlap() : void { $this->expectFailsRuleWithSchema($this->getSchema(), new OverlappingFieldsCanBeMerged, ' { @@ -722,7 +722,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('disallows differing return type list despite no overlap') */ - public function testDisallowsDifferingReturnTypeListDespiteNoOverlap() + public function testDisallowsDifferingReturnTypeListDespiteNoOverlap() : void { $this->expectFailsRuleWithSchema($this->getSchema(), new OverlappingFieldsCanBeMerged, ' { @@ -778,7 +778,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase ]); } - public function testDisallowsDifferingSubfields() + public function testDisallowsDifferingSubfields() : void { $this->expectFailsRuleWithSchema($this->getSchema(), new OverlappingFieldsCanBeMerged, ' { @@ -812,7 +812,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('disallows differing deep return types despite no overlap') */ - public function testDisallowsDifferingDeepReturnTypesDespiteNoOverlap() + public function testDisallowsDifferingDeepReturnTypesDespiteNoOverlap() : void { $this->expectFailsRuleWithSchema($this->getSchema(), new OverlappingFieldsCanBeMerged, ' { @@ -848,7 +848,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('allows non-conflicting overlaping types') */ - public function testAllowsNonConflictingOverlapingTypes() + public function testAllowsNonConflictingOverlapingTypes() : void { $this->expectPassesRuleWithSchema($this->getSchema(), new OverlappingFieldsCanBeMerged, ' { @@ -867,7 +867,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('same wrapped scalar return types') */ - public function testSameWrappedScalarReturnTypes() + public function testSameWrappedScalarReturnTypes() : void { $this->expectPassesRuleWithSchema($this->getSchema(), new OverlappingFieldsCanBeMerged, ' { @@ -886,7 +886,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('allows inline typeless fragments') */ - public function testAllowsInlineTypelessFragments() + public function testAllowsInlineTypelessFragments() : void { $this->expectPassesRuleWithSchema($this->getSchema(), new OverlappingFieldsCanBeMerged, ' { @@ -901,7 +901,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('compares deep types including list') */ - public function testComparesDeepTypesIncludingList() + public function testComparesDeepTypesIncludingList() : void { $this->expectFailsRuleWithSchema($this->getSchema(), new OverlappingFieldsCanBeMerged, ' { @@ -940,7 +940,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('ignores unknown types') */ - public function testIgnoresUnknownTypes() + public function testIgnoresUnknownTypes() : void { $this->expectPassesRuleWithSchema($this->getSchema(), new OverlappingFieldsCanBeMerged, ' { @@ -959,7 +959,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('error message contains hint for alias conflict') */ - public function testErrorMessageContainsHintForAliasConflict() + public function testErrorMessageContainsHintForAliasConflict() : void { // The error template should end with a hint for the user to try using // different aliases. @@ -972,7 +972,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('does not infinite loop on recursive fragment') */ - public function testDoesNotInfiniteLoopOnRecursiveFragment() + public function testDoesNotInfiniteLoopOnRecursiveFragment() : void { $this->expectPassesRule(new OverlappingFieldsCanBeMerged, ' fragment fragA on Human { name, relatives { name, ...fragA } } @@ -982,7 +982,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('does not infinite loop on immediately recursive fragment') */ - public function testDoesNotInfiniteLoopOnImmeditelyRecursiveFragment() + public function testDoesNotInfiniteLoopOnImmeditelyRecursiveFragment() : void { $this->expectPassesRule(new OverlappingFieldsCanBeMerged, ' fragment fragA on Human { name, ...fragA } @@ -992,7 +992,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('does not infinite loop on transitively recursive fragment') */ - public function testDoesNotInfiniteLoopOnTransitivelyRecursiveFragment() + public function testDoesNotInfiniteLoopOnTransitivelyRecursiveFragment() : void { $this->expectPassesRule(new OverlappingFieldsCanBeMerged, ' fragment fragA on Human { name, ...fragB } @@ -1004,7 +1004,7 @@ class OverlappingFieldsCanBeMergedTest extends ValidatorTestCase /** * @see it('find invalid case even with immediately recursive fragment') */ - public function testFindInvalidCaseEvenWithImmediatelyRecursiveFragment() + public function testFindInvalidCaseEvenWithImmediatelyRecursiveFragment() : void { $this->expectFailsRule(new OverlappingFieldsCanBeMerged, ' fragment sameAliasesWithDifferentFieldTargets on Dob { diff --git a/tests/Validator/PossibleFragmentSpreadsTest.php b/tests/Validator/PossibleFragmentSpreadsTest.php index 129ffa9..f5f074b 100644 --- a/tests/Validator/PossibleFragmentSpreadsTest.php +++ b/tests/Validator/PossibleFragmentSpreadsTest.php @@ -12,7 +12,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('of the same object') */ - public function testOfTheSameObject() + public function testOfTheSameObject() : void { $this->expectPassesRule(new PossibleFragmentSpreads(), ' fragment objectWithinObject on Dog { ...dogFragment } @@ -23,7 +23,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('of the same object with inline fragment') */ - public function testOfTheSameObjectWithInlineFragment() + public function testOfTheSameObjectWithInlineFragment() : void { $this->expectPassesRule(new PossibleFragmentSpreads, ' fragment objectWithinObjectAnon on Dog { ... on Dog { barkVolume } } @@ -33,7 +33,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('object into an implemented interface') */ - public function testObjectIntoAnImplementedInterface() + public function testObjectIntoAnImplementedInterface() : void { $this->expectPassesRule(new PossibleFragmentSpreads, ' fragment objectWithinInterface on Pet { ...dogFragment } @@ -44,7 +44,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('object into containing union') */ - public function testObjectIntoContainingUnion() + public function testObjectIntoContainingUnion() : void { $this->expectPassesRule(new PossibleFragmentSpreads, ' fragment objectWithinUnion on CatOrDog { ...dogFragment } @@ -55,7 +55,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('union into contained object') */ - public function testUnionIntoContainedObject() + public function testUnionIntoContainedObject() : void { $this->expectPassesRule(new PossibleFragmentSpreads, ' fragment unionWithinObject on Dog { ...catOrDogFragment } @@ -66,7 +66,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('union into overlapping interface') */ - public function testUnionIntoOverlappingInterface() + public function testUnionIntoOverlappingInterface() : void { $this->expectPassesRule(new PossibleFragmentSpreads, ' fragment unionWithinInterface on Pet { ...catOrDogFragment } @@ -77,7 +77,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('union into overlapping union') */ - public function testUnionIntoOverlappingUnion() + public function testUnionIntoOverlappingUnion() : void { $this->expectPassesRule(new PossibleFragmentSpreads, ' fragment unionWithinUnion on DogOrHuman { ...catOrDogFragment } @@ -88,7 +88,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('interface into implemented object') */ - public function testInterfaceIntoImplementedObject() + public function testInterfaceIntoImplementedObject() : void { $this->expectPassesRule(new PossibleFragmentSpreads, ' fragment interfaceWithinObject on Dog { ...petFragment } @@ -99,7 +99,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('interface into overlapping interface') */ - public function testInterfaceIntoOverlappingInterface() + public function testInterfaceIntoOverlappingInterface() : void { $this->expectPassesRule(new PossibleFragmentSpreads, ' fragment interfaceWithinInterface on Pet { ...beingFragment } @@ -110,7 +110,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('interface into overlapping interface in inline fragment') */ - public function testInterfaceIntoOverlappingInterfaceInInlineFragment() + public function testInterfaceIntoOverlappingInterfaceInInlineFragment() : void { $this->expectPassesRule(new PossibleFragmentSpreads, ' fragment interfaceWithinInterface on Pet { ... on Being { name } } @@ -120,7 +120,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('interface into overlapping union') */ - public function testInterfaceIntoOverlappingUnion() + public function testInterfaceIntoOverlappingUnion() : void { $this->expectPassesRule(new PossibleFragmentSpreads, ' fragment interfaceWithinUnion on CatOrDog { ...petFragment } @@ -131,7 +131,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('ignores incorrect type (caught by FragmentsOnCompositeTypes)') */ - public function testIgnoresIncorrectTypeCaughtByFragmentsOnCompositeTypes() + public function testIgnoresIncorrectTypeCaughtByFragmentsOnCompositeTypes() : void { $this->expectPassesRule(new PossibleFragmentSpreads, ' fragment petFragment on Pet { ...badInADifferentWay } @@ -142,7 +142,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('different object into object') */ - public function testDifferentObjectIntoObject() + public function testDifferentObjectIntoObject() : void { $this->expectFailsRule(new PossibleFragmentSpreads, ' fragment invalidObjectWithinObject on Cat { ...dogFragment } @@ -155,7 +155,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('different object into object in inline fragment') */ - public function testDifferentObjectIntoObjectInInlineFragment() + public function testDifferentObjectIntoObjectInInlineFragment() : void { $this->expectFailsRule(new PossibleFragmentSpreads, ' fragment invalidObjectWithinObjectAnon on Cat { @@ -169,7 +169,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('object into not implementing interface') */ - public function testObjectIntoNotImplementingInterface() + public function testObjectIntoNotImplementingInterface() : void { $this->expectFailsRule(new PossibleFragmentSpreads, ' fragment invalidObjectWithinInterface on Pet { ...humanFragment } @@ -182,7 +182,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('object into not containing union') */ - public function testObjectIntoNotContainingUnion() + public function testObjectIntoNotContainingUnion() : void { $this->expectFailsRule(new PossibleFragmentSpreads, ' fragment invalidObjectWithinUnion on CatOrDog { ...humanFragment } @@ -195,7 +195,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('union into not contained object') */ - public function testUnionIntoNotContainedObject() + public function testUnionIntoNotContainedObject() : void { $this->expectFailsRule(new PossibleFragmentSpreads, ' fragment invalidUnionWithinObject on Human { ...catOrDogFragment } @@ -208,7 +208,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('union into non overlapping interface') */ - public function testUnionIntoNonOverlappingInterface() + public function testUnionIntoNonOverlappingInterface() : void { $this->expectFailsRule(new PossibleFragmentSpreads, ' fragment invalidUnionWithinInterface on Pet { ...humanOrAlienFragment } @@ -221,7 +221,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('union into non overlapping union') */ - public function testUnionIntoNonOverlappingUnion() + public function testUnionIntoNonOverlappingUnion() : void { $this->expectFailsRule(new PossibleFragmentSpreads, ' fragment invalidUnionWithinUnion on CatOrDog { ...humanOrAlienFragment } @@ -234,7 +234,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('interface into non implementing object') */ - public function testInterfaceIntoNonImplementingObject() + public function testInterfaceIntoNonImplementingObject() : void { $this->expectFailsRule(new PossibleFragmentSpreads, ' fragment invalidInterfaceWithinObject on Cat { ...intelligentFragment } @@ -247,7 +247,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('interface into non overlapping interface') */ - public function testInterfaceIntoNonOverlappingInterface() + public function testInterfaceIntoNonOverlappingInterface() : void { // Ideally this should fail, but our new lazy schema doesn't scan through all types and fields // So we don't have enough knowledge to check interface intersection and always allow this to pass: @@ -263,7 +263,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('interface into non overlapping interface in inline fragment') */ - public function testInterfaceIntoNonOverlappingInterfaceInInlineFragment() + public function testInterfaceIntoNonOverlappingInterfaceInInlineFragment() : void { // Ideally this should fail, but our new lazy schema doesn't scan through all types and fields // So we don't have enough knowledge to check interface intersection and always allow this to pass: @@ -278,7 +278,7 @@ class PossibleFragmentSpreadsTest extends ValidatorTestCase /** * @see it('interface into non overlapping union') */ - public function testInterfaceIntoNonOverlappingUnion() + public function testInterfaceIntoNonOverlappingUnion() : void { $this->expectFailsRule(new PossibleFragmentSpreads, ' fragment invalidInterfaceWithinUnion on HumanOrAlien { ...petFragment } diff --git a/tests/Validator/ProvidedNonNullArgumentsTest.php b/tests/Validator/ProvidedNonNullArgumentsTest.php index a68ba97..25291e7 100644 --- a/tests/Validator/ProvidedNonNullArgumentsTest.php +++ b/tests/Validator/ProvidedNonNullArgumentsTest.php @@ -12,7 +12,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('ignores unknown arguments') */ - public function testIgnoresUnknownArguments() + public function testIgnoresUnknownArguments() : void { // ignores unknown arguments $this->expectPassesRule(new ProvidedNonNullArguments, ' @@ -29,7 +29,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('Arg on optional arg') */ - public function testArgOnOptionalArg() + public function testArgOnOptionalArg() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -43,7 +43,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('No Arg on optional arg') */ - public function testNoArgOnOptionalArg() + public function testNoArgOnOptionalArg() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -57,7 +57,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('Multiple args') */ - public function testMultipleArgs() + public function testMultipleArgs() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -71,7 +71,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('Multiple args reverse order') */ - public function testMultipleArgsReverseOrder() + public function testMultipleArgsReverseOrder() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -85,7 +85,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('No args on multiple optional') */ - public function testNoArgsOnMultipleOptional() + public function testNoArgsOnMultipleOptional() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -99,7 +99,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('One arg on multiple optional') */ - public function testOneArgOnMultipleOptional() + public function testOneArgOnMultipleOptional() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -113,7 +113,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('Second arg on multiple optional') */ - public function testSecondArgOnMultipleOptional() + public function testSecondArgOnMultipleOptional() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -127,7 +127,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('Multiple reqs on mixedList') */ - public function testMultipleReqsOnMixedList() + public function testMultipleReqsOnMixedList() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -141,7 +141,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('Multiple reqs and one opt on mixedList') */ - public function testMultipleReqsAndOneOptOnMixedList() + public function testMultipleReqsAndOneOptOnMixedList() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -155,7 +155,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('All reqs and opts on mixedList') */ - public function testAllReqsAndOptsOnMixedList() + public function testAllReqsAndOptsOnMixedList() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -171,7 +171,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('Missing one non-nullable argument') */ - public function testMissingOneNonNullableArgument() + public function testMissingOneNonNullableArgument() : void { $this->expectFailsRule(new ProvidedNonNullArguments, ' { @@ -187,7 +187,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('Missing multiple non-nullable arguments') */ - public function testMissingMultipleNonNullableArguments() + public function testMissingMultipleNonNullableArguments() : void { $this->expectFailsRule(new ProvidedNonNullArguments, ' { @@ -204,7 +204,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('Incorrect value and missing argument') */ - public function testIncorrectValueAndMissingArgument() + public function testIncorrectValueAndMissingArgument() : void { $this->expectFailsRule(new ProvidedNonNullArguments, ' { @@ -222,7 +222,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('ignores unknown directives') */ - public function testIgnoresUnknownDirectives() + public function testIgnoresUnknownDirectives() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -234,7 +234,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('with directives of valid types') */ - public function testWithDirectivesOfValidTypes() + public function testWithDirectivesOfValidTypes() : void { $this->expectPassesRule(new ProvidedNonNullArguments, ' { @@ -251,7 +251,7 @@ class ProvidedNonNullArgumentsTest extends ValidatorTestCase /** * @see it('with directive with missing types') */ - public function testWithDirectiveWithMissingTypes() + public function testWithDirectiveWithMissingTypes() : void { $this->expectFailsRule(new ProvidedNonNullArguments, ' { diff --git a/tests/Validator/QueryComplexityTest.php b/tests/Validator/QueryComplexityTest.php index ed6d74f..dcc1852 100644 --- a/tests/Validator/QueryComplexityTest.php +++ b/tests/Validator/QueryComplexityTest.php @@ -41,49 +41,49 @@ class QueryComplexityTest extends QuerySecurityTestCase return self::$rule; } - public function testSimpleQueries() + public function testSimpleQueries() : void { $query = 'query MyQuery { human { firstName } }'; $this->assertDocumentValidators($query, 2, 3); } - public function testInlineFragmentQueries() + public function testInlineFragmentQueries() : void { $query = 'query MyQuery { human { ... on Human { firstName } } }'; $this->assertDocumentValidators($query, 2, 3); } - public function testFragmentQueries() + public function testFragmentQueries() : void { $query = 'query MyQuery { human { ...F1 } } fragment F1 on Human { firstName}'; $this->assertDocumentValidators($query, 2, 3); } - public function testAliasesQueries() + public function testAliasesQueries() : void { $query = 'query MyQuery { thomas: human(name: "Thomas") { firstName } jeremy: human(name: "Jeremy") { firstName } }'; $this->assertDocumentValidators($query, 4, 5); } - public function testCustomComplexityQueries() + public function testCustomComplexityQueries() : void { $query = 'query MyQuery { human { dogs { name } } }'; $this->assertDocumentValidators($query, 12, 13); } - public function testCustomComplexityWithArgsQueries() + public function testCustomComplexityWithArgsQueries() : void { $query = 'query MyQuery { human { dogs(name: "Root") { name } } }'; $this->assertDocumentValidators($query, 3, 4); } - public function testCustomComplexityWithVariablesQueries() + public function testCustomComplexityWithVariablesQueries() : void { $query = 'query MyQuery($dog: String!) { human { dogs(name: $dog) { name } } }'; @@ -92,7 +92,7 @@ class QueryComplexityTest extends QuerySecurityTestCase $this->assertDocumentValidators($query, 3, 4); } - public function testQueryWithEnabledIncludeDirectives() + public function testQueryWithEnabledIncludeDirectives() : void { $query = 'query MyQuery($withDogs: Boolean!) { human { dogs(name: "Root") @include(if:$withDogs) { name } } }'; @@ -101,7 +101,7 @@ class QueryComplexityTest extends QuerySecurityTestCase $this->assertDocumentValidators($query, 3, 4); } - public function testQueryWithDisabledIncludeDirectives() + public function testQueryWithDisabledIncludeDirectives() : void { $query = 'query MyQuery($withDogs: Boolean!) { human { dogs(name: "Root") @include(if:$withDogs) { name } } }'; @@ -110,7 +110,7 @@ class QueryComplexityTest extends QuerySecurityTestCase $this->assertDocumentValidators($query, 1, 2); } - public function testQueryWithEnabledSkipDirectives() + public function testQueryWithEnabledSkipDirectives() : void { $query = 'query MyQuery($withoutDogs: Boolean!) { human { dogs(name: "Root") @skip(if:$withoutDogs) { name } } }'; @@ -119,7 +119,7 @@ class QueryComplexityTest extends QuerySecurityTestCase $this->assertDocumentValidators($query, 1, 2); } - public function testQueryWithDisabledSkipDirectives() + public function testQueryWithDisabledSkipDirectives() : void { $query = 'query MyQuery($withoutDogs: Boolean!) { human { dogs(name: "Root") @skip(if:$withoutDogs) { name } } }'; @@ -128,7 +128,7 @@ class QueryComplexityTest extends QuerySecurityTestCase $this->assertDocumentValidators($query, 3, 4); } - public function testQueryWithMultipleDirectives() + public function testQueryWithMultipleDirectives() : void { $query = 'query MyQuery($withDogs: Boolean!, $withoutDogName: Boolean!) { human { dogs(name: "Root") @include(if:$withDogs) { name @skip(if:$withoutDogName) } } }'; @@ -140,22 +140,22 @@ class QueryComplexityTest extends QuerySecurityTestCase $this->assertDocumentValidators($query, 2, 3); } - public function testComplexityIntrospectionQuery() + public function testComplexityIntrospectionQuery() : void { $this->assertIntrospectionQuery(181); } - public function testIntrospectionTypeMetaFieldQuery() + public function testIntrospectionTypeMetaFieldQuery() : void { $this->assertIntrospectionTypeMetaFieldQuery(2); } - public function testTypeNameMetaFieldQuery() + public function testTypeNameMetaFieldQuery() : void { $this->assertTypeNameMetaFieldQuery(3); } - public function testSkippedWhenThereAreOtherValidationErrors() + public function testSkippedWhenThereAreOtherValidationErrors() : void { $query = 'query MyQuery { human(name: INVALID_VALUE) { dogs {name} } }'; diff --git a/tests/Validator/QueryDepthTest.php b/tests/Validator/QueryDepthTest.php index 5f63936..1063156 100644 --- a/tests/Validator/QueryDepthTest.php +++ b/tests/Validator/QueryDepthTest.php @@ -32,7 +32,7 @@ class QueryDepthTest extends QuerySecurityTestCase * @param array $expectedErrors * @dataProvider queryDataProvider */ - public function testSimpleQueries($queryDepth, $maxQueryDepth = 7, $expectedErrors = []) + public function testSimpleQueries($queryDepth, $maxQueryDepth = 7, $expectedErrors = []) : void { $this->assertDocumentValidator($this->buildRecursiveQuery($queryDepth), $maxQueryDepth, $expectedErrors); } @@ -43,7 +43,7 @@ class QueryDepthTest extends QuerySecurityTestCase * @param array $expectedErrors * @dataProvider queryDataProvider */ - public function testFragmentQueries($queryDepth, $maxQueryDepth = 7, $expectedErrors = []) + public function testFragmentQueries($queryDepth, $maxQueryDepth = 7, $expectedErrors = []) : void { $this->assertDocumentValidator($this->buildRecursiveUsingFragmentQuery($queryDepth), $maxQueryDepth, $expectedErrors); } @@ -54,22 +54,22 @@ class QueryDepthTest extends QuerySecurityTestCase * @param array $expectedErrors * @dataProvider queryDataProvider */ - public function testInlineFragmentQueries($queryDepth, $maxQueryDepth = 7, $expectedErrors = []) + public function testInlineFragmentQueries($queryDepth, $maxQueryDepth = 7, $expectedErrors = []) : void { $this->assertDocumentValidator($this->buildRecursiveUsingInlineFragmentQuery($queryDepth), $maxQueryDepth, $expectedErrors); } - public function testComplexityIntrospectionQuery() + public function testComplexityIntrospectionQuery() : void { $this->assertIntrospectionQuery(11); } - public function testIntrospectionTypeMetaFieldQuery() + public function testIntrospectionTypeMetaFieldQuery() : void { $this->assertIntrospectionTypeMetaFieldQuery(1); } - public function testTypeNameMetaFieldQuery() + public function testTypeNameMetaFieldQuery() : void { $this->assertTypeNameMetaFieldQuery(1); } diff --git a/tests/Validator/QuerySecurityTestCase.php b/tests/Validator/QuerySecurityTestCase.php index 9bb07aa..5188e3e 100644 --- a/tests/Validator/QuerySecurityTestCase.php +++ b/tests/Validator/QuerySecurityTestCase.php @@ -29,7 +29,7 @@ abstract class QuerySecurityTestCase extends TestCase * @expectedException \InvalidArgumentException * @expectedExceptionMessage argument must be greater or equal to 0. */ - public function testMaxQueryDepthMustBeGreaterOrEqualTo0() + public function testMaxQueryDepthMustBeGreaterOrEqualTo0() : void { $this->getRule(-1); } diff --git a/tests/Validator/ScalarLeafsTest.php b/tests/Validator/ScalarLeafsTest.php index 2027295..1d9db96 100644 --- a/tests/Validator/ScalarLeafsTest.php +++ b/tests/Validator/ScalarLeafsTest.php @@ -12,7 +12,7 @@ class ScalarLeafsTest extends ValidatorTestCase /** * @see it('valid scalar selection') */ - public function testValidScalarSelection() + public function testValidScalarSelection() : void { $this->expectPassesRule(new ScalarLeafs, ' fragment scalarSelection on Dog { @@ -24,7 +24,7 @@ class ScalarLeafsTest extends ValidatorTestCase /** * @see it('object type missing selection') */ - public function testObjectTypeMissingSelection() + public function testObjectTypeMissingSelection() : void { $this->expectFailsRule(new ScalarLeafs, ' query directQueryOnObjectWithoutSubFields { @@ -36,7 +36,7 @@ class ScalarLeafsTest extends ValidatorTestCase /** * @see it('interface type missing selection') */ - public function testInterfaceTypeMissingSelection() + public function testInterfaceTypeMissingSelection() : void { $this->expectFailsRule(new ScalarLeafs, ' { @@ -48,7 +48,7 @@ class ScalarLeafsTest extends ValidatorTestCase /** * @see it('valid scalar selection with args') */ - public function testValidScalarSelectionWithArgs() + public function testValidScalarSelectionWithArgs() : void { $this->expectPassesRule(new ScalarLeafs, ' fragment scalarSelectionWithArgs on Dog { @@ -60,7 +60,7 @@ class ScalarLeafsTest extends ValidatorTestCase /** * @see it('scalar selection not allowed on Boolean') */ - public function testScalarSelectionNotAllowedOnBoolean() + public function testScalarSelectionNotAllowedOnBoolean() : void { $this->expectFailsRule(new ScalarLeafs, ' fragment scalarSelectionsNotAllowedOnBoolean on Dog { @@ -73,7 +73,7 @@ class ScalarLeafsTest extends ValidatorTestCase /** * @see it('scalar selection not allowed on Enum') */ - public function testScalarSelectionNotAllowedOnEnum() + public function testScalarSelectionNotAllowedOnEnum() : void { $this->expectFailsRule(new ScalarLeafs, ' fragment scalarSelectionsNotAllowedOnEnum on Cat { @@ -87,7 +87,7 @@ class ScalarLeafsTest extends ValidatorTestCase /** * @see it('scalar selection not allowed with args') */ - public function testScalarSelectionNotAllowedWithArgs() + public function testScalarSelectionNotAllowedWithArgs() : void { $this->expectFailsRule(new ScalarLeafs, ' fragment scalarSelectionsNotAllowedWithArgs on Dog { @@ -101,7 +101,7 @@ class ScalarLeafsTest extends ValidatorTestCase /** * @see it('Scalar selection not allowed with directives') */ - public function testScalarSelectionNotAllowedWithDirectives() + public function testScalarSelectionNotAllowedWithDirectives() : void { $this->expectFailsRule(new ScalarLeafs, ' fragment scalarSelectionsNotAllowedWithDirectives on Dog { @@ -115,7 +115,7 @@ class ScalarLeafsTest extends ValidatorTestCase /** * @see it('Scalar selection not allowed with directives and args') */ - public function testScalarSelectionNotAllowedWithDirectivesAndArgs() + public function testScalarSelectionNotAllowedWithDirectivesAndArgs() : void { $this->expectFailsRule(new ScalarLeafs, ' fragment scalarSelectionsNotAllowedWithDirectivesAndArgs on Dog { diff --git a/tests/Validator/UniqueArgumentNamesTest.php b/tests/Validator/UniqueArgumentNamesTest.php index 8df6840..4652aa1 100644 --- a/tests/Validator/UniqueArgumentNamesTest.php +++ b/tests/Validator/UniqueArgumentNamesTest.php @@ -12,7 +12,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('no arguments on field') */ - public function testNoArgumentsOnField() + public function testNoArgumentsOnField() : void { $this->expectPassesRule(new UniqueArgumentNames(), ' { @@ -24,7 +24,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('no arguments on directive') */ - public function testNoArgumentsOnDirective() + public function testNoArgumentsOnDirective() : void { $this->expectPassesRule(new UniqueArgumentNames, ' { @@ -36,7 +36,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('argument on field') */ - public function testArgumentOnField() + public function testArgumentOnField() : void { $this->expectPassesRule(new UniqueArgumentNames, ' { @@ -48,7 +48,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('argument on directive') */ - public function testArgumentOnDirective() + public function testArgumentOnDirective() : void { $this->expectPassesRule(new UniqueArgumentNames, ' { @@ -60,7 +60,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('same argument on two fields') */ - public function testSameArgumentOnTwoFields() + public function testSameArgumentOnTwoFields() : void { $this->expectPassesRule(new UniqueArgumentNames, ' { @@ -73,7 +73,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('same argument on field and directive') */ - public function testSameArgumentOnFieldAndDirective() + public function testSameArgumentOnFieldAndDirective() : void { $this->expectPassesRule(new UniqueArgumentNames, ' { @@ -85,7 +85,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('same argument on two directives') */ - public function testSameArgumentOnTwoDirectives() + public function testSameArgumentOnTwoDirectives() : void { $this->expectPassesRule(new UniqueArgumentNames, ' { @@ -97,7 +97,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('multiple field arguments') */ - public function testMultipleFieldArguments() + public function testMultipleFieldArguments() : void { $this->expectPassesRule(new UniqueArgumentNames, ' { @@ -109,7 +109,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('multiple directive arguments') */ - public function testMultipleDirectiveArguments() + public function testMultipleDirectiveArguments() : void { $this->expectPassesRule(new UniqueArgumentNames, ' { @@ -121,7 +121,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('duplicate field arguments') */ - public function testDuplicateFieldArguments() + public function testDuplicateFieldArguments() : void { $this->expectFailsRule(new UniqueArgumentNames, ' { @@ -135,7 +135,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('many duplicate field arguments') */ - public function testManyDuplicateFieldArguments() + public function testManyDuplicateFieldArguments() : void { $this->expectFailsRule(new UniqueArgumentNames, ' { @@ -150,7 +150,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('duplicate directive arguments') */ - public function testDuplicateDirectiveArguments() + public function testDuplicateDirectiveArguments() : void { $this->expectFailsRule(new UniqueArgumentNames, ' { @@ -164,7 +164,7 @@ class UniqueArgumentNamesTest extends ValidatorTestCase /** * @see it('many duplicate directive arguments') */ - public function testManyDuplicateDirectiveArguments() + public function testManyDuplicateDirectiveArguments() : void { $this->expectFailsRule(new UniqueArgumentNames, ' { diff --git a/tests/Validator/UniqueDirectivesPerLocationTest.php b/tests/Validator/UniqueDirectivesPerLocationTest.php index c08f55d..199f106 100644 --- a/tests/Validator/UniqueDirectivesPerLocationTest.php +++ b/tests/Validator/UniqueDirectivesPerLocationTest.php @@ -8,7 +8,7 @@ class UniqueDirectivesPerLocationTest extends ValidatorTestCase /** * @see it('no directives') */ - public function testNoDirectives() + public function testNoDirectives() : void { $this->expectPassesRule(new UniqueDirectivesPerLocation(), ' fragment Test on Type { @@ -20,7 +20,7 @@ class UniqueDirectivesPerLocationTest extends ValidatorTestCase /** * @see it('unique directives in different locations') */ - public function testUniqueDirectivesInDifferentLocations() + public function testUniqueDirectivesInDifferentLocations() : void { $this->expectPassesRule(new UniqueDirectivesPerLocation(), ' fragment Test on Type @directiveA { @@ -32,7 +32,7 @@ class UniqueDirectivesPerLocationTest extends ValidatorTestCase /** * @see it('unique directives in same locations') */ - public function testUniqueDirectivesInSameLocations() + public function testUniqueDirectivesInSameLocations() : void { $this->expectPassesRule(new UniqueDirectivesPerLocation(), ' fragment Test on Type @directiveA @directiveB { @@ -44,7 +44,7 @@ class UniqueDirectivesPerLocationTest extends ValidatorTestCase /** * @see it('same directives in different locations') */ - public function testSameDirectivesInDifferentLocations() + public function testSameDirectivesInDifferentLocations() : void { $this->expectPassesRule(new UniqueDirectivesPerLocation(), ' fragment Test on Type @directiveA { @@ -56,7 +56,7 @@ class UniqueDirectivesPerLocationTest extends ValidatorTestCase /** * @see it('same directives in similar locations') */ - public function testSameDirectivesInSimilarLocations() + public function testSameDirectivesInSimilarLocations() : void { $this->expectPassesRule(new UniqueDirectivesPerLocation(), ' fragment Test on Type { @@ -69,7 +69,7 @@ class UniqueDirectivesPerLocationTest extends ValidatorTestCase /** * @see it('duplicate directives in one location') */ - public function testDuplicateDirectivesInOneLocation() + public function testDuplicateDirectivesInOneLocation() : void { $this->expectFailsRule(new UniqueDirectivesPerLocation(), ' fragment Test on Type { @@ -83,7 +83,7 @@ class UniqueDirectivesPerLocationTest extends ValidatorTestCase /** * @see it('many duplicate directives in one location') */ - public function testManyDuplicateDirectivesInOneLocation() + public function testManyDuplicateDirectivesInOneLocation() : void { $this->expectFailsRule(new UniqueDirectivesPerLocation(), ' fragment Test on Type { @@ -98,7 +98,7 @@ class UniqueDirectivesPerLocationTest extends ValidatorTestCase /** * @see it('different duplicate directives in one location') */ - public function testDifferentDuplicateDirectivesInOneLocation() + public function testDifferentDuplicateDirectivesInOneLocation() : void { $this->expectFailsRule(new UniqueDirectivesPerLocation, ' fragment Test on Type { @@ -113,7 +113,7 @@ class UniqueDirectivesPerLocationTest extends ValidatorTestCase /** * @see it('duplicate directives in many locations') */ - public function testDuplicateDirectivesInManyLocations() + public function testDuplicateDirectivesInManyLocations() : void { $this->expectFailsRule(new UniqueDirectivesPerLocation(), ' fragment Test on Type @directive @directive { diff --git a/tests/Validator/UniqueFragmentNamesTest.php b/tests/Validator/UniqueFragmentNamesTest.php index d3923e9..426e803 100644 --- a/tests/Validator/UniqueFragmentNamesTest.php +++ b/tests/Validator/UniqueFragmentNamesTest.php @@ -12,7 +12,7 @@ class UniqueFragmentNamesTest extends ValidatorTestCase /** * @see it('no fragments') */ - public function testNoFragments() + public function testNoFragments() : void { $this->expectPassesRule(new UniqueFragmentNames(), ' { @@ -24,7 +24,7 @@ class UniqueFragmentNamesTest extends ValidatorTestCase /** * @see it('one fragment') */ - public function testOneFragment() + public function testOneFragment() : void { $this->expectPassesRule(new UniqueFragmentNames, ' { @@ -40,7 +40,7 @@ class UniqueFragmentNamesTest extends ValidatorTestCase /** * @see it('many fragments') */ - public function testManyFragments() + public function testManyFragments() : void { $this->expectPassesRule(new UniqueFragmentNames, ' { @@ -63,7 +63,7 @@ class UniqueFragmentNamesTest extends ValidatorTestCase /** * @see it('inline fragments are always unique') */ - public function testInlineFragmentsAreAlwaysUnique() + public function testInlineFragmentsAreAlwaysUnique() : void { $this->expectPassesRule(new UniqueFragmentNames, ' { @@ -80,7 +80,7 @@ class UniqueFragmentNamesTest extends ValidatorTestCase /** * @see it('fragment and operation named the same') */ - public function testFragmentAndOperationNamedTheSame() + public function testFragmentAndOperationNamedTheSame() : void { $this->expectPassesRule(new UniqueFragmentNames, ' query Foo { @@ -95,7 +95,7 @@ class UniqueFragmentNamesTest extends ValidatorTestCase /** * @see it('fragments named the same') */ - public function testFragmentsNamedTheSame() + public function testFragmentsNamedTheSame() : void { $this->expectFailsRule(new UniqueFragmentNames, ' { @@ -115,7 +115,7 @@ class UniqueFragmentNamesTest extends ValidatorTestCase /** * @see it('fragments named the same without being referenced') */ - public function testFragmentsNamedTheSameWithoutBeingReferenced() + public function testFragmentsNamedTheSameWithoutBeingReferenced() : void { $this->expectFailsRule(new UniqueFragmentNames, ' fragment fragA on Type { diff --git a/tests/Validator/UniqueInputFieldNamesTest.php b/tests/Validator/UniqueInputFieldNamesTest.php index 4ac48b2..676dea3 100644 --- a/tests/Validator/UniqueInputFieldNamesTest.php +++ b/tests/Validator/UniqueInputFieldNamesTest.php @@ -12,7 +12,7 @@ class UniqueInputFieldNamesTest extends ValidatorTestCase /** * @see it('input object with fields') */ - public function testInputObjectWithFields() + public function testInputObjectWithFields() : void { $this->expectPassesRule(new UniqueInputFieldNames(), ' { @@ -24,7 +24,7 @@ class UniqueInputFieldNamesTest extends ValidatorTestCase /** * @see it('same input object within two args') */ - public function testSameInputObjectWithinTwoArgs() + public function testSameInputObjectWithinTwoArgs() : void { $this->expectPassesRule(new UniqueInputFieldNames, ' { @@ -36,7 +36,7 @@ class UniqueInputFieldNamesTest extends ValidatorTestCase /** * @see it('multiple input object fields') */ - public function testMultipleInputObjectFields() + public function testMultipleInputObjectFields() : void { $this->expectPassesRule(new UniqueInputFieldNames, ' { @@ -48,7 +48,7 @@ class UniqueInputFieldNamesTest extends ValidatorTestCase /** * @see it('allows for nested input objects with similar fields') */ - public function testAllowsForNestedInputObjectsWithSimilarFields() + public function testAllowsForNestedInputObjectsWithSimilarFields() : void { $this->expectPassesRule(new UniqueInputFieldNames, ' { @@ -68,7 +68,7 @@ class UniqueInputFieldNamesTest extends ValidatorTestCase /** * @see it('duplicate input object fields') */ - public function testDuplicateInputObjectFields() + public function testDuplicateInputObjectFields() : void { $this->expectFailsRule(new UniqueInputFieldNames, ' { @@ -82,7 +82,7 @@ class UniqueInputFieldNamesTest extends ValidatorTestCase /** * @see it('many duplicate input object fields') */ - public function testManyDuplicateInputObjectFields() + public function testManyDuplicateInputObjectFields() : void { $this->expectFailsRule(new UniqueInputFieldNames, ' { diff --git a/tests/Validator/UniqueOperationNamesTest.php b/tests/Validator/UniqueOperationNamesTest.php index f0a9f02..11cecdc 100644 --- a/tests/Validator/UniqueOperationNamesTest.php +++ b/tests/Validator/UniqueOperationNamesTest.php @@ -12,7 +12,7 @@ class UniqueOperationNamesTest extends ValidatorTestCase /** * @see it('no operations') */ - public function testNoOperations() + public function testNoOperations() : void { $this->expectPassesRule(new UniqueOperationNames(), ' fragment fragA on Type { @@ -24,7 +24,7 @@ class UniqueOperationNamesTest extends ValidatorTestCase /** * @see it('one anon operation') */ - public function testOneAnonOperation() + public function testOneAnonOperation() : void { $this->expectPassesRule(new UniqueOperationNames, ' { @@ -36,7 +36,7 @@ class UniqueOperationNamesTest extends ValidatorTestCase /** * @see it('one named operation') */ - public function testOneNamedOperation() + public function testOneNamedOperation() : void { $this->expectPassesRule(new UniqueOperationNames, ' query Foo { @@ -48,7 +48,7 @@ class UniqueOperationNamesTest extends ValidatorTestCase /** * @see it('multiple operations') */ - public function testMultipleOperations() + public function testMultipleOperations() : void { $this->expectPassesRule(new UniqueOperationNames, ' query Foo { @@ -64,7 +64,7 @@ class UniqueOperationNamesTest extends ValidatorTestCase /** * @see it('multiple operations of different types') */ - public function testMultipleOperationsOfDifferentTypes() + public function testMultipleOperationsOfDifferentTypes() : void { $this->expectPassesRule(new UniqueOperationNames, ' query Foo { @@ -84,7 +84,7 @@ class UniqueOperationNamesTest extends ValidatorTestCase /** * @see it('fragment and operation named the same') */ - public function testFragmentAndOperationNamedTheSame() + public function testFragmentAndOperationNamedTheSame() : void { $this->expectPassesRule(new UniqueOperationNames, ' query Foo { @@ -99,7 +99,7 @@ class UniqueOperationNamesTest extends ValidatorTestCase /** * @see it('multiple operations of same name') */ - public function testMultipleOperationsOfSameName() + public function testMultipleOperationsOfSameName() : void { $this->expectFailsRule(new UniqueOperationNames, ' query Foo { @@ -116,7 +116,7 @@ class UniqueOperationNamesTest extends ValidatorTestCase /** * @see it('multiple ops of same name of different types (mutation)') */ - public function testMultipleOpsOfSameNameOfDifferentTypes_Mutation() + public function testMultipleOpsOfSameNameOfDifferentTypesMutation() : void { $this->expectFailsRule(new UniqueOperationNames, ' query Foo { @@ -133,7 +133,7 @@ class UniqueOperationNamesTest extends ValidatorTestCase /** * @see it('multiple ops of same name of different types (subscription)') */ - public function testMultipleOpsOfSameNameOfDifferentTypes_Subscription() + public function testMultipleOpsOfSameNameOfDifferentTypesSubscription() : void { $this->expectFailsRule(new UniqueOperationNames, ' query Foo { diff --git a/tests/Validator/UniqueVariableNamesTest.php b/tests/Validator/UniqueVariableNamesTest.php index 2b93a91..a5776a4 100644 --- a/tests/Validator/UniqueVariableNamesTest.php +++ b/tests/Validator/UniqueVariableNamesTest.php @@ -12,7 +12,7 @@ class UniqueVariableNamesTest extends ValidatorTestCase /** * @see it('unique variable names') */ - public function testUniqueVariableNames() + public function testUniqueVariableNames() : void { $this->expectPassesRule(new UniqueVariableNames(), ' query A($x: Int, $y: String) { __typename } @@ -23,7 +23,7 @@ class UniqueVariableNamesTest extends ValidatorTestCase /** * @see it('duplicate variable names') */ - public function testDuplicateVariableNames() + public function testDuplicateVariableNames() : void { $this->expectFailsRule(new UniqueVariableNames, ' query A($x: Int, $x: Int, $x: String) { __typename } diff --git a/tests/Validator/ValidationTest.php b/tests/Validator/ValidationTest.php index 6d008f7..7bfb4b2 100644 --- a/tests/Validator/ValidationTest.php +++ b/tests/Validator/ValidationTest.php @@ -8,7 +8,7 @@ class ValidationTest extends ValidatorTestCase /** * @see it('validates queries') */ - public function testValidatesQueries() + public function testValidatesQueries() : void { $this->expectPassesCompleteValidation(' query { @@ -27,7 +27,7 @@ class ValidationTest extends ValidatorTestCase /** * @see it('detects bad scalar parse') */ - public function testDetectsBadScalarParse() + public function testDetectsBadScalarParse() : void { $doc = ' query { @@ -48,7 +48,7 @@ class ValidationTest extends ValidatorTestCase ); } - public function testPassesValidationWithEmptyRules() + public function testPassesValidationWithEmptyRules() : void { $query = '{invalid}'; diff --git a/tests/Validator/ValuesOfCorrectTypeTest.php b/tests/Validator/ValuesOfCorrectTypeTest.php index 3bf4bb2..2d9f79b 100644 --- a/tests/Validator/ValuesOfCorrectTypeTest.php +++ b/tests/Validator/ValuesOfCorrectTypeTest.php @@ -47,7 +47,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Good int value') */ - public function testGoodIntValue() + public function testGoodIntValue() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -61,7 +61,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Good negative int value') */ - public function testGoodNegativeIntValue() + public function testGoodNegativeIntValue() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -75,7 +75,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Good boolean value') */ - public function testGoodBooleanValue() + public function testGoodBooleanValue() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -89,7 +89,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Good string value') */ - public function testGoodStringValue() + public function testGoodStringValue() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -103,7 +103,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Good float value') */ - public function testGoodFloatValue() + public function testGoodFloatValue() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -114,7 +114,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase '); } - public function testGoodNegativeFloatValue() + public function testGoodNegativeFloatValue() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -128,7 +128,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Int into Float') */ - public function testIntIntoFloat() + public function testIntIntoFloat() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -142,7 +142,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Int into ID') */ - public function testIntIntoID() + public function testIntIntoID() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -156,7 +156,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('String into ID') */ - public function testStringIntoID() + public function testStringIntoID() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -170,7 +170,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Good enum value') */ - public function testGoodEnumValue() + public function testGoodEnumValue() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -184,7 +184,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Enum with null value') */ - public function testEnumWithNullValue() + public function testEnumWithNullValue() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -198,7 +198,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('null into nullable type') */ - public function testNullIntoNullableType() + public function testNullIntoNullableType() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -222,7 +222,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Int into String') */ - public function testIntIntoString() + public function testIntIntoString() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -238,7 +238,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Float into String') */ - public function testFloatIntoString() + public function testFloatIntoString() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -254,7 +254,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Boolean into String') */ - public function testBooleanIntoString() + public function testBooleanIntoString() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -270,7 +270,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Unquoted String into String') */ - public function testUnquotedStringIntoString() + public function testUnquotedStringIntoString() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -288,7 +288,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('String into Int') */ - public function testStringIntoInt() + public function testStringIntoInt() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -304,7 +304,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Big Int into Int') */ - public function testBigIntIntoInt() + public function testBigIntIntoInt() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -320,7 +320,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Unquoted String into Int') */ - public function testUnquotedStringIntoInt() + public function testUnquotedStringIntoInt() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -336,7 +336,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Simple Float into Int') */ - public function testSimpleFloatIntoInt() + public function testSimpleFloatIntoInt() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -352,7 +352,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Float into Int') */ - public function testFloatIntoInt() + public function testFloatIntoInt() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -370,7 +370,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('String into Float') */ - public function testStringIntoFloat() + public function testStringIntoFloat() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -386,7 +386,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Boolean into Float') */ - public function testBooleanIntoFloat() + public function testBooleanIntoFloat() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -402,7 +402,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Unquoted into Float') */ - public function testUnquotedIntoFloat() + public function testUnquotedIntoFloat() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -420,7 +420,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Int into Boolean') */ - public function testIntIntoBoolean() + public function testIntIntoBoolean() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -436,7 +436,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Float into Boolean') */ - public function testFloatIntoBoolean() + public function testFloatIntoBoolean() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -452,7 +452,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('String into Boolean') */ - public function testStringIntoBoolean() + public function testStringIntoBoolean() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -468,7 +468,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Unquoted into Boolean') */ - public function testUnquotedIntoBoolean() + public function testUnquotedIntoBoolean() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -486,7 +486,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Float into ID') */ - public function testFloatIntoID() + public function testFloatIntoID() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -502,7 +502,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Boolean into ID') */ - public function testBooleanIntoID() + public function testBooleanIntoID() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -518,7 +518,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Unquoted into ID') */ - public function testUnquotedIntoID() + public function testUnquotedIntoID() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -536,7 +536,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Int into Enum') */ - public function testIntIntoEnum() + public function testIntIntoEnum() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -552,7 +552,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Float into Enum') */ - public function testFloatIntoEnum() + public function testFloatIntoEnum() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -568,7 +568,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('String into Enum') */ - public function testStringIntoEnum() + public function testStringIntoEnum() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -590,7 +590,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Boolean into Enum') */ - public function testBooleanIntoEnum() + public function testBooleanIntoEnum() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -606,7 +606,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Unknown Enum Value into Enum') */ - public function testUnknownEnumValueIntoEnum() + public function testUnknownEnumValueIntoEnum() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -622,7 +622,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Different case Enum Value into Enum') */ - public function testDifferentCaseEnumValueIntoEnum() + public function testDifferentCaseEnumValueIntoEnum() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -646,7 +646,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Good list value') */ - public function testGoodListValue() + public function testGoodListValue() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -660,7 +660,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Empty list value') */ - public function testEmptyListValue() + public function testEmptyListValue() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -674,7 +674,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Null value') */ - public function testNullValue() + public function testNullValue() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -688,7 +688,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Single value into List') */ - public function testSingleValueIntoList() + public function testSingleValueIntoList() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -704,7 +704,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Incorrect item type') */ - public function testIncorrectItemtype() + public function testIncorrectItemtype() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -720,7 +720,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Single value of incorrect type') */ - public function testSingleValueOfIncorrectType() + public function testSingleValueOfIncorrectType() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -738,7 +738,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Arg on optional arg') */ - public function testArgOnOptionalArg() + public function testArgOnOptionalArg() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -752,7 +752,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('No Arg on optional arg') */ - public function testNoArgOnOptionalArg() + public function testNoArgOnOptionalArg() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -766,7 +766,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Multiple args') */ - public function testMultipleArgs() + public function testMultipleArgs() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -780,7 +780,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Multiple args reverse order') */ - public function testMultipleArgsReverseOrder() + public function testMultipleArgsReverseOrder() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -794,7 +794,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('No args on multiple optional') */ - public function testNoArgsOnMultipleOptional() + public function testNoArgsOnMultipleOptional() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -808,7 +808,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('One arg on multiple optional') */ - public function testOneArgOnMultipleOptional() + public function testOneArgOnMultipleOptional() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -822,7 +822,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Second arg on multiple optional') */ - public function testSecondArgOnMultipleOptional() + public function testSecondArgOnMultipleOptional() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -836,7 +836,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Multiple reqs on mixedList') */ - public function testMultipleReqsOnMixedList() + public function testMultipleReqsOnMixedList() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -850,7 +850,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Multiple reqs and one opt on mixedList') */ - public function testMultipleReqsAndOneOptOnMixedList() + public function testMultipleReqsAndOneOptOnMixedList() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -864,7 +864,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('All reqs and opts on mixedList') */ - public function testAllReqsAndOptsOnMixedList() + public function testAllReqsAndOptsOnMixedList() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -880,7 +880,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Incorrect value type') */ - public function testIncorrectValueType() + public function testIncorrectValueType() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -897,7 +897,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Incorrect value and missing argument (ProvidedNonNullArguments)') */ - public function testIncorrectValueAndMissingArgumentProvidedNonNullArguments() + public function testIncorrectValueAndMissingArgumentProvidedNonNullArguments() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -913,7 +913,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Null value') */ - public function testNullValue2() + public function testNullValue2() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -932,7 +932,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Optional arg, despite required field in type') */ - public function testOptionalArgDespiteRequiredFieldInType() + public function testOptionalArgDespiteRequiredFieldInType() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -946,7 +946,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Partial object, only required') */ - public function testPartialObjectOnlyRequired() + public function testPartialObjectOnlyRequired() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -960,7 +960,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Partial object, required field can be falsey') */ - public function testPartialObjectRequiredFieldCanBeFalsey() + public function testPartialObjectRequiredFieldCanBeFalsey() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -974,7 +974,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Partial object, including required') */ - public function testPartialObjectIncludingRequired() + public function testPartialObjectIncludingRequired() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -988,7 +988,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Full object') */ - public function testFullObject() + public function testFullObject() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -1008,7 +1008,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Full object with fields in different order') */ - public function testFullObjectWithFieldsInDifferentOrder() + public function testFullObjectWithFieldsInDifferentOrder() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -1030,7 +1030,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Partial object, missing required') */ - public function testPartialObjectMissingRequired() + public function testPartialObjectMissingRequired() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -1046,7 +1046,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('Partial object, invalid field type') */ - public function testPartialObjectInvalidFieldType() + public function testPartialObjectInvalidFieldType() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -1068,7 +1068,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase * The sorting of equal elements has changed so that the test fails on php < 7 * @requires PHP 7.0 */ - public function testPartialObjectUnknownFieldArg() + public function testPartialObjectUnknownFieldArg() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -1095,7 +1095,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('reports original error for custom scalar which throws') */ - public function testReportsOriginalErrorForCustomScalarWhichThrows() + public function testReportsOriginalErrorForCustomScalarWhichThrows() : void { $errors = $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -1120,7 +1120,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('allows custom scalar to accept complex literals') */ - public function testAllowsCustomScalarToAcceptComplexLiterals() + public function testAllowsCustomScalarToAcceptComplexLiterals() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -1137,7 +1137,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('with directives of valid types') */ - public function testWithDirectivesOfValidTypes() + public function testWithDirectivesOfValidTypes() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' { @@ -1154,7 +1154,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('with directive with incorrect types') */ - public function testWithDirectiveWithIncorrectTypes() + public function testWithDirectiveWithIncorrectTypes() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' { @@ -1173,7 +1173,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('variables with valid default values') */ - public function testVariablesWithValidDefaultValues() + public function testVariablesWithValidDefaultValues() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' query WithDefaultValues( @@ -1189,7 +1189,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('variables with valid default null values') */ - public function testVariablesWithValidDefaultNullValues() + public function testVariablesWithValidDefaultNullValues() : void { $this->expectPassesRule(new ValuesOfCorrectType, ' query WithDefaultValues( @@ -1205,7 +1205,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('variables with invalid default null values') */ - public function testVariablesWithInvalidDefaultNullValues() + public function testVariablesWithInvalidDefaultNullValues() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' query WithDefaultValues( @@ -1225,7 +1225,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('variables with invalid default values') */ - public function testVariablesWithInvalidDefaultValues() + public function testVariablesWithInvalidDefaultValues() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' query InvalidDefaultValues( @@ -1245,7 +1245,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('variables with complex invalid default values') */ - public function testVariablesWithComplexInvalidDefaultValues() + public function testVariablesWithComplexInvalidDefaultValues() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' query WithDefaultValues( @@ -1262,7 +1262,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('complex variables missing required field') */ - public function testComplexVariablesMissingRequiredField() + public function testComplexVariablesMissingRequiredField() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' query MissingRequiredField($a: ComplexInput = {intField: 3}) { @@ -1276,7 +1276,7 @@ class ValuesOfCorrectTypeTest extends ValidatorTestCase /** * @see it('list variables with invalid item') */ - public function testListVariablesWithInvalidItem() + public function testListVariablesWithInvalidItem() : void { $this->expectFailsRule(new ValuesOfCorrectType, ' query InvalidItem($a: [String] = ["one", 2]) { diff --git a/tests/Validator/VariablesAreInputTypesTest.php b/tests/Validator/VariablesAreInputTypesTest.php index c37a0ee..5031434 100644 --- a/tests/Validator/VariablesAreInputTypesTest.php +++ b/tests/Validator/VariablesAreInputTypesTest.php @@ -12,7 +12,7 @@ class VariablesAreInputTypesTest extends ValidatorTestCase /** * @see it('input types are valid') */ - public function testInputTypesAreValid() + public function testInputTypesAreValid() : void { $this->expectPassesRule(new VariablesAreInputTypes(), ' query Foo($a: String, $b: [Boolean!]!, $c: ComplexInput) { @@ -24,7 +24,7 @@ class VariablesAreInputTypesTest extends ValidatorTestCase /** * @see it('output types are invalid') */ - public function testOutputTypesAreInvalid() + public function testOutputTypesAreInvalid() : void { $this->expectFailsRule(new VariablesAreInputTypes, ' query Foo($a: Dog, $b: [[CatOrDog!]]!, $c: Pet) { diff --git a/tests/Validator/VariablesDefaultValueAllowedTest.php b/tests/Validator/VariablesDefaultValueAllowedTest.php index 0fb543b..468b6a4 100644 --- a/tests/Validator/VariablesDefaultValueAllowedTest.php +++ b/tests/Validator/VariablesDefaultValueAllowedTest.php @@ -24,7 +24,7 @@ class VariablesDefaultValueAllowedTest extends ValidatorTestCase /** * @see it('variables with no default values') */ - public function testVariablesWithNoDefaultValues() + public function testVariablesWithNoDefaultValues() : void { $this->expectPassesRule(new VariablesDefaultValueAllowed(), ' query NullableValues($a: Int, $b: String, $c: ComplexInput) { @@ -36,7 +36,7 @@ class VariablesDefaultValueAllowedTest extends ValidatorTestCase /** * @see it('required variables without default values') */ - public function testRequiredVariablesWithoutDefaultValues() + public function testRequiredVariablesWithoutDefaultValues() : void { $this->expectPassesRule(new VariablesDefaultValueAllowed(), ' query RequiredValues($a: Int!, $b: String!) { @@ -48,7 +48,7 @@ class VariablesDefaultValueAllowedTest extends ValidatorTestCase /** * @see it('variables with valid default values') */ - public function testVariablesWithValidDefaultValues() + public function testVariablesWithValidDefaultValues() : void { $this->expectPassesRule(new VariablesDefaultValueAllowed(), ' query WithDefaultValues( @@ -64,7 +64,7 @@ class VariablesDefaultValueAllowedTest extends ValidatorTestCase /** * @see it('variables with valid default null values') */ - public function testVariablesWithValidDefaultNullValues() + public function testVariablesWithValidDefaultNullValues() : void { $this->expectPassesRule(new VariablesDefaultValueAllowed(), ' query WithDefaultValues( @@ -80,7 +80,7 @@ class VariablesDefaultValueAllowedTest extends ValidatorTestCase /** * @see it('no required variables with default values') */ - public function testNoRequiredVariablesWithDefaultValues() + public function testNoRequiredVariablesWithDefaultValues() : void { $this->expectFailsRule(new VariablesDefaultValueAllowed(), ' query UnreachableDefaultValues($a: Int! = 3, $b: String! = "default") { @@ -95,7 +95,7 @@ class VariablesDefaultValueAllowedTest extends ValidatorTestCase /** * @see it('variables with invalid default null values') */ - public function testNullIntoNullableType() + public function testNullIntoNullableType() : void { $this->expectFailsRule(new VariablesDefaultValueAllowed(), ' query WithDefaultValues($a: Int! = null, $b: String! = null) { diff --git a/tests/Validator/VariablesInAllowedPositionTest.php b/tests/Validator/VariablesInAllowedPositionTest.php index 1defd36..fa8a69a 100644 --- a/tests/Validator/VariablesInAllowedPositionTest.php +++ b/tests/Validator/VariablesInAllowedPositionTest.php @@ -12,7 +12,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('Boolean => Boolean') */ - public function testBooleanXBoolean() + public function testBooleanXBoolean() : void { // Boolean => Boolean $this->expectPassesRule(new VariablesInAllowedPosition(), ' @@ -28,7 +28,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('Boolean => Boolean within fragment') */ - public function testBooleanXBooleanWithinFragment() + public function testBooleanXBooleanWithinFragment() : void { // Boolean => Boolean within fragment $this->expectPassesRule(new VariablesInAllowedPosition, ' @@ -59,7 +59,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('Boolean! => Boolean') */ - public function testBooleanNonNullXBoolean() + public function testBooleanNonNullXBoolean() : void { // Boolean! => Boolean $this->expectPassesRule(new VariablesInAllowedPosition, ' @@ -75,7 +75,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('Boolean! => Boolean within fragment') */ - public function testBooleanNonNullXBooleanWithinFragment() + public function testBooleanNonNullXBooleanWithinFragment() : void { // Boolean! => Boolean within fragment $this->expectPassesRule(new VariablesInAllowedPosition, ' @@ -95,7 +95,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('Int => Int! with default') */ - public function testIntXIntNonNullWithDefault() + public function testIntXIntNonNullWithDefault() : void { // Int => Int! with default $this->expectPassesRule(new VariablesInAllowedPosition, ' @@ -111,7 +111,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('[String] => [String]') */ - public function testListOfStringXListOfString() + public function testListOfStringXListOfString() : void { $this->expectPassesRule(new VariablesInAllowedPosition, ' query Query($stringListVar: [String]) @@ -126,7 +126,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('[String!] => [String]') */ - public function testListOfStringNonNullXListOfString() + public function testListOfStringNonNullXListOfString() : void { $this->expectPassesRule(new VariablesInAllowedPosition, ' query Query($stringListVar: [String!]) @@ -141,7 +141,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('String => [String] in item position') */ - public function testStringXListOfStringInItemPosition() + public function testStringXListOfStringInItemPosition() : void { $this->expectPassesRule(new VariablesInAllowedPosition, ' query Query($stringVar: String) @@ -156,7 +156,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('String! => [String] in item position') */ - public function testStringNonNullXListOfStringInItemPosition() + public function testStringNonNullXListOfStringInItemPosition() : void { $this->expectPassesRule(new VariablesInAllowedPosition, ' query Query($stringVar: String!) @@ -171,7 +171,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('ComplexInput => ComplexInput') */ - public function testComplexInputXComplexInput() + public function testComplexInputXComplexInput() : void { $this->expectPassesRule(new VariablesInAllowedPosition, ' query Query($complexVar: ComplexInput) @@ -186,7 +186,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('ComplexInput => ComplexInput in field position') */ - public function testComplexInputXComplexInputInFieldPosition() + public function testComplexInputXComplexInputInFieldPosition() : void { $this->expectPassesRule(new VariablesInAllowedPosition, ' query Query($boolVar: Boolean = false) @@ -201,7 +201,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('Boolean! => Boolean! in directive') */ - public function testBooleanNonNullXBooleanNonNullInDirective() + public function testBooleanNonNullXBooleanNonNullInDirective() : void { $this->expectPassesRule(new VariablesInAllowedPosition, ' query Query($boolVar: Boolean!) @@ -214,7 +214,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('Boolean => Boolean! in directive with default') */ - public function testBooleanXBooleanNonNullInDirectiveWithDefault() + public function testBooleanXBooleanNonNullInDirectiveWithDefault() : void { $this->expectPassesRule(new VariablesInAllowedPosition, ' query Query($boolVar: Boolean = false) @@ -227,7 +227,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('Int => Int!') */ - public function testIntXIntNonNull() + public function testIntXIntNonNull() : void { $this->expectFailsRule(new VariablesInAllowedPosition, ' query Query($intArg: Int) { @@ -246,7 +246,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('Int => Int! within fragment') */ - public function testIntXIntNonNullWithinFragment() + public function testIntXIntNonNullWithinFragment() : void { $this->expectFailsRule(new VariablesInAllowedPosition, ' fragment nonNullIntArgFieldFrag on ComplicatedArgs { @@ -269,7 +269,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('Int => Int! within nested fragment') */ - public function testIntXIntNonNullWithinNestedFragment() + public function testIntXIntNonNullWithinNestedFragment() : void { // Int => Int! within nested fragment $this->expectFailsRule(new VariablesInAllowedPosition, ' @@ -298,7 +298,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('String over Boolean') */ - public function testStringOverBoolean() + public function testStringOverBoolean() : void { $this->expectFailsRule(new VariablesInAllowedPosition, ' query Query($stringVar: String) { @@ -317,7 +317,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('String => [String]') */ - public function testStringXListOfString() + public function testStringXListOfString() : void { $this->expectFailsRule(new VariablesInAllowedPosition, ' query Query($stringVar: String) { @@ -336,7 +336,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('Boolean => Boolean! in directive') */ - public function testBooleanXBooleanNonNullInDirective() + public function testBooleanXBooleanNonNullInDirective() : void { $this->expectFailsRule(new VariablesInAllowedPosition, ' query Query($boolVar: Boolean) { @@ -353,7 +353,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('String => Boolean! in directive') */ - public function testStringXBooleanNonNullInDirective() + public function testStringXBooleanNonNullInDirective() : void { // String => Boolean! in directive $this->expectFailsRule(new VariablesInAllowedPosition, ' @@ -371,7 +371,7 @@ class VariablesInAllowedPositionTest extends ValidatorTestCase /** * @see it('[String] => [String!]') */ - public function testStringArrayXStringNonNullArray() + public function testStringArrayXStringNonNullArray() : void { $this->expectFailsRule( new VariablesInAllowedPosition,