Skip to content

Commit 79a2657

Browse files
committed
Preserve composer override and normalize GraphQL test literals to #2748
1 parent 0588842 commit 79a2657

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"illuminate/validation": "^9 || ^10 || ^11 || ^12",
4141
"laragraph/utils": "^1.5 || ^2",
4242
"thecodingmachine/safe": "^1 || ^2 || ^3",
43-
"webonyx/graphql-php": "^15"
43+
"webonyx/graphql-php": "dev-nodelist-array-access as 15.1.1"
4444
},
4545
"require-dev": {
4646
"algolia/algoliasearch-client-php": "^3",

tests/Unit/Schema/Directives/BaseDirectiveTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ final class BaseDirectiveTest extends TestCase
2525
{
2626
public function testGetsModelClassFromDirective(): void
2727
{
28-
$this->schema .= /** @lang GraphQL */ '
28+
$this->schema .= /** @lang GraphQL */ <<<'GRAPHQL'
2929
type User @model(class: "Team") {
3030
id: ID
3131
}
32-
';
32+
GRAPHQL;
3333

3434
$directive = $this->constructFieldDirective('foo: User @dummy');
3535

@@ -41,11 +41,11 @@ public function testGetsModelClassFromDirective(): void
4141

4242
public function testDefaultsToFieldTypeForTheModelClass(): void
4343
{
44-
$this->schema .= /** @lang GraphQL */ '
44+
$this->schema .= /** @lang GraphQL */ <<<'GRAPHQL'
4545
type User {
4646
id: ID
4747
}
48-
';
48+
GRAPHQL;
4949

5050
$directive = $this->constructFieldDirective('foo: User @dummy');
5151

@@ -75,11 +75,11 @@ public function testBuiltInTypeTolerated(): void
7575

7676
public function testThrowsIfTheClassIsNotAModel(): void
7777
{
78-
$this->schema .= /** @lang GraphQL */ '
78+
$this->schema .= /** @lang GraphQL */ <<<'GRAPHQL'
7979
type Exception {
8080
id: ID
8181
}
82-
';
82+
GRAPHQL;
8383

8484
$directive = $this->constructFieldDirective('foo: Exception @dummy');
8585

@@ -89,11 +89,11 @@ public function testThrowsIfTheClassIsNotAModel(): void
8989

9090
public function testResolvesAModelThatIsNamedLikeABaseClass(): void
9191
{
92-
$this->schema .= /** @lang GraphQL */ '
92+
$this->schema .= /** @lang GraphQL */ <<<'GRAPHQL'
9393
type Closure {
9494
id: ID
9595
}
96-
';
96+
GRAPHQL;
9797

9898
$directive = $this->constructFieldDirective('foo: Closure @dummy');
9999

@@ -105,11 +105,11 @@ public function testResolvesAModelThatIsNamedLikeABaseClass(): void
105105

106106
public function testPrefersThePrimaryModelNamespace(): void
107107
{
108-
$this->schema .= /** @lang GraphQL */ '
108+
$this->schema .= /** @lang GraphQL */ <<<'GRAPHQL'
109109
type Category {
110110
id: ID
111111
}
112-
';
112+
GRAPHQL;
113113

114114
$directive = $this->constructFieldDirective('foo: Category @dummy');
115115

@@ -121,11 +121,11 @@ public function testPrefersThePrimaryModelNamespace(): void
121121

122122
public function testAllowsOverwritingTheDefaultModel(): void
123123
{
124-
$this->schema .= /** @lang GraphQL */ '
124+
$this->schema .= /** @lang GraphQL */ <<<'GRAPHQL'
125125
type OnlyHere {
126126
id: ID
127127
}
128-
';
128+
GRAPHQL;
129129

130130
$directive = $this->constructFieldDirective('foo: OnlyHere @dummy(model: "Tests\\\Utils\\\ModelsSecondary\\\Category")');
131131

@@ -137,11 +137,11 @@ public function testAllowsOverwritingTheDefaultModel(): void
137137

138138
public function testResolvesFromTheSecondaryModelNamespace(): void
139139
{
140-
$this->schema .= /** @lang GraphQL */ '
140+
$this->schema .= /** @lang GraphQL */ <<<'GRAPHQL'
141141
type OnlyHere {
142142
id: ID
143143
}
144-
';
144+
GRAPHQL;
145145

146146
$directive = $this->constructFieldDirective('foo: OnlyHere @dummy');
147147

tests/Unit/Schema/ResolverProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ public function testThrowsIfRootFieldHasNoResolver(): void
5858

5959
protected function constructFieldValue(string $fieldDefinition, string $parentTypeName = RootType::QUERY): FieldValue
6060
{
61-
$queryType = Parser::objectTypeDefinition(/** @lang GraphQL */ "
61+
$queryType = Parser::objectTypeDefinition(/** @lang GraphQL */ <<<GRAPHQL
6262
type {$parentTypeName} {
6363
{$fieldDefinition}
6464
}
65-
");
65+
GRAPHQL);
6666

6767
$typeValue = new TypeValue($queryType);
6868

0 commit comments

Comments
 (0)