From d8ce97e9f6feeb8e7fa7b7866ef38e92fbd94bf7 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 18 Jan 2023 10:53:35 +0100 Subject: [PATCH] Improve test indentation --- .../PrintFederationSchemaCommandTest.php | 6 ++--- .../AutomaticPersistedQueriesTest.php | 3 +-- .../CacheControlDirectiveTest.php | 12 ++++----- .../Directives/HasManyDirectiveTest.php | 3 +-- .../Arguments/ArgumentSetFactoryTest.php | 27 +++++++++---------- 5 files changed, 23 insertions(+), 28 deletions(-) diff --git a/tests/Console/PrintFederationSchemaCommandTest.php b/tests/Console/PrintFederationSchemaCommandTest.php index ec41c6fb77..a8e4d13a6c 100644 --- a/tests/Console/PrintFederationSchemaCommandTest.php +++ b/tests/Console/PrintFederationSchemaCommandTest.php @@ -9,8 +9,7 @@ final class PrintFederationSchemaCommandTest extends TestCase { - protected const SCHEMA_TYPE /** @lang GraphQL */ - = <<<'GRAPHQL' + protected const SCHEMA_TYPE = /** @lang GraphQL */ <<<'GRAPHQL' type Foo @key(fields: "id") { id: ID! @external foo: String! @@ -18,8 +17,7 @@ final class PrintFederationSchemaCommandTest extends TestCase GRAPHQL; - protected const SCHEMA_QUERY /** @lang GraphQL */ - = <<<'GRAPHQL' + protected const SCHEMA_QUERY = /** @lang GraphQL */ <<<'GRAPHQL' type Query { foo: Int! } diff --git a/tests/Integration/AutomaticPersistedQueriesTest.php b/tests/Integration/AutomaticPersistedQueriesTest.php index 615719e40a..d5460d3971 100644 --- a/tests/Integration/AutomaticPersistedQueriesTest.php +++ b/tests/Integration/AutomaticPersistedQueriesTest.php @@ -117,8 +117,7 @@ public function testCacheDisabled(): void $config->set('lighthouse.query_cache.enable', false); $config->set('lighthouse.persisted_queries', true); - $query /** @lang GraphQL */ - = ' + $query = /** @lang GraphQL */ ' { foo } diff --git a/tests/Integration/CacheControl/CacheControlDirectiveTest.php b/tests/Integration/CacheControl/CacheControlDirectiveTest.php index ce797a15ba..b2f5e037d4 100644 --- a/tests/Integration/CacheControl/CacheControlDirectiveTest.php +++ b/tests/Integration/CacheControl/CacheControlDirectiveTest.php @@ -17,7 +17,7 @@ public function testDefaultAppResponseHeader(): void 'name' => 'foobar', ]); - $this->schema /** @lang GraphQL */ = ' + $this->schema = /** @lang GraphQL */ ' type User { id: ID! name: String @@ -43,7 +43,7 @@ public function testInheritance(): void 'id' => 1, ]); - $this->schema /** @lang GraphQL */ = ' + $this->schema = /** @lang GraphQL */ ' type User { id: ID! } @@ -69,7 +69,7 @@ public function testRootScalar(string $query, string $expectedHeaderString): voi { $this->mockResolver(1); - $this->schema /** @lang GraphQL */ = ' + $this->schema = /** @lang GraphQL */ ' type Query { default: ID @mock withDirective: ID @mock @cacheControl(maxAge: 5) @@ -115,7 +115,7 @@ public function testInheritanceWithNonScalar(): void 'self' => null, ]); - $this->schema /** @lang GraphQL */ = ' + $this->schema = /** @lang GraphQL */ ' type User { id: ID! child: User @@ -147,7 +147,7 @@ public function testDirectiveArguments(string $directive, string $expectedHeader 'name' => 'foobar', ]); - $this->schema /** @lang GraphQL */ = " + $this->schema = /** @lang GraphQL */ " type User { id: ID! name: String {$directive} @@ -187,7 +187,7 @@ public static function argumentsDataProvider(): array */ public function testUseDirectiveNested(string $query, string $expectedHeaderString): void { - $this->schema /** @lang GraphQL */ = ' + $this->schema = /** @lang GraphQL */ ' type User { tasks: [Task!]! @hasMany @cacheControl(maxAge: 50) posts: [Post!]! @hasMany diff --git a/tests/Integration/Schema/Directives/HasManyDirectiveTest.php b/tests/Integration/Schema/Directives/HasManyDirectiveTest.php index 6d97d564d4..7280f9fc34 100644 --- a/tests/Integration/Schema/Directives/HasManyDirectiveTest.php +++ b/tests/Integration/Schema/Directives/HasManyDirectiveTest.php @@ -299,8 +299,7 @@ public function testQueryPaginatedHasManyWithConditionInDifferentAliases(): void public function testQueryPaginatedHasManyWithNonUniqueForeignKey(): void { - $this->schema /** @lang GraphQL */ - = ' + $this->schema = /** @lang GraphQL */ ' type Post { roles: [RoleUser!]! @hasMany(relation: "roles", type: PAGINATOR, defaultCount: 10) } diff --git a/tests/Unit/Execution/Arguments/ArgumentSetFactoryTest.php b/tests/Unit/Execution/Arguments/ArgumentSetFactoryTest.php index 6fe7d8e6e0..c4902db059 100644 --- a/tests/Unit/Execution/Arguments/ArgumentSetFactoryTest.php +++ b/tests/Unit/Execution/Arguments/ArgumentSetFactoryTest.php @@ -75,24 +75,23 @@ public function testItsListsAllTheWayDown(): void } '; - $barValue - // Level 1 - = [ - // Level 2 + // Level 1 + $barValue = [ + // Level 2 + [ + // Level 3 [ - // Level 3 + // Level 4 [ - // Level 4 - [ - 1, 2, - ], - [ - 3, null, - ], + 1, 2, + ], + [ + 3, null, ], - null, ], - ]; + null, + ], + ]; $argumentSet = $this->rootQueryArgumentSet([ 'bar' => $barValue,