Skip to content

Commit 85aabf7

Browse files
committed
Spread Schema options across multiple lines in tests
1 parent 225ddc4 commit 85aabf7

23 files changed

+198
-66
lines changed

tests/Executor/AbstractTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,9 @@ public function testHintsOnConflictingTypeInstancesInResolveType(): void
751751
],
752752
]);
753753

754-
$schema = new Schema(['query' => $query]);
754+
$schema = new Schema([
755+
'query' => $query,
756+
]);
755757
$schema->assertValid();
756758

757759
$query = '

tests/Executor/DeferredFieldsTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,9 @@ public function testComplexRecursiveDeferredFields(): void
452452
},
453453
]);
454454

455-
$schema = new Schema(['query' => $complexType]);
455+
$schema = new Schema([
456+
'query' => $complexType,
457+
]);
456458

457459
$query = Parser::parse('
458460
{

tests/Executor/ExecutorSchemaTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ public function testExecutesUsingASchema(): void
105105
],
106106
]);
107107

108-
$BlogSchema = new Schema(['query' => $BlogQuery]);
108+
$BlogSchema = new Schema([
109+
'query' => $BlogQuery,
110+
]);
109111

110112
$request = '
111113
{

tests/Executor/ExecutorTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ public function testExecutesArbitraryCode(): void
156156
'deeper' => ['type' => Type::listOf($dataType)],
157157
],
158158
]);
159-
$schema = new Schema(['query' => $dataType]);
159+
$schema = new Schema([
160+
'query' => $dataType,
161+
]);
160162

161163
self::assertEquals(
162164
$expected,
@@ -205,7 +207,9 @@ public function testMergesParallelFragments(): void
205207
},
206208
]);
207209

208-
$schema = new Schema(['query' => $Type]);
210+
$schema = new Schema([
211+
'query' => $Type,
212+
]);
209213
$expected = [
210214
'data' => [
211215
'a' => 'Apple',
@@ -826,7 +830,9 @@ public function testCorrectFieldOrderingDespiteExecutionOrder(): void
826830
'e' => ['type' => Type::string()],
827831
],
828832
]);
829-
$schema = new Schema(['query' => $queryType]);
833+
$schema = new Schema([
834+
'query' => $queryType,
835+
]);
830836

831837
$expected = [
832838
'data' => [

tests/Executor/ListsTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ private function check(Type $testType, $testData, array $expected, int $debug =
8686
},
8787
]);
8888

89-
$schema = new Schema(['query' => $dataType]);
89+
$schema = new Schema([
90+
'query' => $dataType,
91+
]);
9092

9193
$ast = Parser::parse('{ nest { test } }');
9294

tests/Executor/NonNullTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ protected function setUp(): void
106106
},
107107
]);
108108

109-
$this->schema = new Schema(['query' => $dataType]);
109+
$this->schema = new Schema([
110+
'query' => $dataType,
111+
]);
110112

111113
$this->schemaWithNonNullArg = new Schema([
112114
'query' => new ObjectType([

tests/Executor/UnionInterfaceTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,9 @@ public function testGetsExecutionInfoInResolver(): void
550550
],
551551
]);
552552

553-
$schema2 = new Schema(['query' => $PersonType2]);
553+
$schema2 = new Schema([
554+
'query' => $PersonType2,
555+
]);
554556

555557
$john2 = new Person('John', [], [$this->liz]);
556558

tests/Executor/VariablesTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ private function schema(): Schema
194194
],
195195
]);
196196

197-
return new Schema(['query' => $TestType]);
197+
return new Schema([
198+
'query' => $TestType,
199+
]);
198200
}
199201

200202
/**

tests/IntegerFloatPrimitiveIntrospectionTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ public static function build(): Schema
3535
],
3636
]);
3737

38-
return new Schema(['query' => $queryType]);
38+
return new Schema([
39+
'query' => $queryType,
40+
]);
3941
}
4042

4143
public function testDefaultValues(): void

tests/Regression/Issue396Test.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public function testUnionResolveType(): void
5959
],
6060
]);
6161

62-
$schema = new Schema(['query' => $exampleType]);
62+
$schema = new Schema([
63+
'query' => $exampleType,
64+
]);
6365

6466
$query = '
6567
query {

0 commit comments

Comments
 (0)