99
1010final class BelongsToManyTest extends DBTestCase
1111{
12- protected string $ schema = /** @lang GraphQL */ '
12+ protected string $ schema = /** @lang GraphQL */ <<<'GRAPHQL '
1313 type Role {
1414 id: ID!
1515 name: String
@@ -143,7 +143,7 @@ public function testSyncWithoutDetaching(): void
143143 }
144144 }
145145 }
146- ' )->assertJson ([
146+ GRAPHQL )->assertJson ([
147147 'data ' => [
148148 'createUser ' => [
149149 'id ' => '1 ' ,
@@ -173,7 +173,7 @@ public function testSyncWithoutDetaching(): void
173173
174174 public function testCreateWithNewBelongsToMany (): void
175175 {
176- $ this ->graphQL (/** @lang GraphQL */ '
176+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
177177 mutation {
178178 createRole(input: {
179179 name: "foobar"
@@ -196,7 +196,7 @@ public function testCreateWithNewBelongsToMany(): void
196196 }
197197 }
198198 }
199- ' )->assertJson ([
199+ GRAPHQL )->assertJson ([
200200 'data ' => [
201201 'createRole ' => [
202202 'id ' => '1 ' ,
@@ -214,7 +214,7 @@ public function testCreateWithNewBelongsToMany(): void
214214
215215 public function testUpsertWithBelongsToManyOnNonExistentData (): void
216216 {
217- $ this ->graphQL (/** @lang GraphQL */ '
217+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
218218 mutation {
219219 upsertRole(input: {
220220 id: 1
@@ -240,7 +240,7 @@ public function testUpsertWithBelongsToManyOnNonExistentData(): void
240240 }
241241 }
242242 }
243- ' )->assertJson ([
243+ GRAPHQL )->assertJson ([
244244 'data ' => [
245245 'upsertRole ' => [
246246 'id ' => '1 ' ,
@@ -328,7 +328,7 @@ public function testCreateAndConnectWithBelongsToMany(): void
328328 $ user ->name = 'user_two ' ;
329329 $ user ->save ();
330330
331- $ this ->graphQL (/** @lang GraphQL */ '
331+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
332332 mutation {
333333 createRole(input: {
334334 name: "foobar"
@@ -344,7 +344,7 @@ public function testCreateAndConnectWithBelongsToMany(): void
344344 }
345345 }
346346 }
347- ' )->assertJson ([
347+ GRAPHQL )->assertJson ([
348348 'data ' => [
349349 'createRole ' => [
350350 'id ' => '1 ' ,
@@ -376,7 +376,7 @@ public function testUpsertUsingCreationAndConnectWithBelongsToMany(): void
376376 $ user ->name = 'user_two ' ;
377377 $ user ->save ();
378378
379- $ this ->graphQL (/** @lang GraphQL */ '
379+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
380380 mutation {
381381 upsertRole(input: {
382382 id: 1
@@ -393,7 +393,7 @@ public function testUpsertUsingCreationAndConnectWithBelongsToMany(): void
393393 }
394394 }
395395 }
396- ' )->assertJson ([
396+ GRAPHQL )->assertJson ([
397397 'data ' => [
398398 'upsertRole ' => [
399399 'id ' => '1 ' ,
@@ -420,7 +420,7 @@ public function testCreateWithBelongsToMany(): void
420420 $ role ->name = 'is_admin ' ;
421421 $ role ->save ();
422422
423- $ this ->graphQL (/** @lang GraphQL */ '
423+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
424424 mutation {
425425 updateRole(input: {
426426 id: 1
@@ -444,7 +444,7 @@ public function testCreateWithBelongsToMany(): void
444444 }
445445 }
446446 }
447- ' )->assertJson ([
447+ GRAPHQL )->assertJson ([
448448 'data ' => [
449449 'updateRole ' => [
450450 'id ' => '1 ' ,
@@ -473,7 +473,7 @@ public function testAllowsNullOperations(): void
473473 {
474474 factory (Role::class)->create ();
475475
476- $ this ->graphQL (/** @lang GraphQL */ '
476+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
477477 mutation {
478478 updateRole(input: {
479479 id: 1
@@ -497,7 +497,7 @@ public function testAllowsNullOperations(): void
497497 }
498498 }
499499 }
500- ' )->assertJson ([
500+ GRAPHQL )->assertJson ([
501501 'data ' => [
502502 'updateRole ' => [
503503 'id ' => '1 ' ,
@@ -515,7 +515,7 @@ public function testUpsertUsingCreationWithBelongsToMany(): void
515515 $ role ->name = 'is_admin ' ;
516516 $ role ->save ();
517517
518- $ this ->graphQL (/** @lang GraphQL */ '
518+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
519519 mutation {
520520 updateRole(input: {
521521 id: 1
@@ -541,7 +541,7 @@ public function testUpsertUsingCreationWithBelongsToMany(): void
541541 }
542542 }
543543 }
544- ' )->assertJson ([
544+ GRAPHQL )->assertJson ([
545545 'data ' => [
546546 'updateRole ' => [
547547 'id ' => '1 ' ,
@@ -893,7 +893,7 @@ public function testSyncExistingUsersDuringCreateToABelongsToManyRelation(): voi
893893 {
894894 factory (User::class, 2 )->create ();
895895
896- $ this ->graphQL (/** @lang GraphQL */ '
896+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
897897 mutation {
898898 createRole(input: {
899899 name: "foobar"
@@ -908,7 +908,7 @@ public function testSyncExistingUsersDuringCreateToABelongsToManyRelation(): voi
908908 }
909909 }
910910 }
911- ' )->assertJson ([
911+ GRAPHQL )->assertJson ([
912912 'data ' => [
913913 'createRole ' => [
914914 'id ' => '1 ' ,
@@ -930,7 +930,7 @@ public function testSyncExistingUsersDuringCreateUsingUpsertToABelongsToManyRela
930930 {
931931 factory (User::class, 2 )->create ();
932932
933- $ this ->graphQL (/** @lang GraphQL */ '
933+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
934934 mutation {
935935 upsertRole(input: {
936936 id: 1
@@ -946,7 +946,7 @@ public function testSyncExistingUsersDuringCreateUsingUpsertToABelongsToManyRela
946946 }
947947 }
948948 }
949- ' )->assertJson ([
949+ GRAPHQL )->assertJson ([
950950 'data ' => [
951951 'upsertRole ' => [
952952 'id ' => '1 ' ,
@@ -976,7 +976,7 @@ public function testDisconnectAllRelatedModelsOnEmptySync(string $action): void
976976
977977 $ this ->assertCount (1 , $ role ->users );
978978
979- $ this ->graphQL (/** @lang GraphQL */ "
979+ $ this ->graphQL (/** @lang GraphQL */ <<<GRAPHQL
980980 mutation {
981981 {$ action }Role(input: {
982982 id: 1
@@ -991,7 +991,7 @@ public function testDisconnectAllRelatedModelsOnEmptySync(string $action): void
991991 }
992992 }
993993 }
994- " )->assertJson ([
994+ GRAPHQL )->assertJson ([
995995 'data ' => [
996996 "{$ action }Role " => [
997997 'id ' => '1 ' ,
@@ -1017,7 +1017,7 @@ public function testConnectUserWithRoleAndPivotMetaByUsingSync(): void
10171017
10181018 $ meta = Lorem::sentence ();
10191019
1020- $ this ->graphQL (/** @lang GraphQL */ '
1020+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
10211021 mutation ($meta: String) {
10221022 pivotsUpdateUser(input: {
10231023 id: 1,
@@ -1041,7 +1041,7 @@ public function testConnectUserWithRoleAndPivotMetaByUsingSync(): void
10411041 }
10421042 }
10431043 }
1044- ' , [
1044+ GRAPHQL , [
10451045 'meta ' => $ meta ,
10461046 ])->assertJson ([
10471047 'data ' => [
@@ -1076,7 +1076,7 @@ public function testConnectUserWithRoleAndPivotMetaByUsingSyncWithoutDetach(): v
10761076
10771077 $ meta = Lorem::sentence ();
10781078
1079- $ this ->graphQL (/** @lang GraphQL */ '
1079+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
10801080 mutation ($meta: String) {
10811081 pivotsUpdateUser(input: {
10821082 id: 1,
@@ -1096,7 +1096,7 @@ public function testConnectUserWithRoleAndPivotMetaByUsingSyncWithoutDetach(): v
10961096 }
10971097 }
10981098 }
1099- ' , [
1099+ GRAPHQL , [
11001100 'meta ' => $ meta ,
11011101 ])->assertJson ([
11021102 'data ' => [
@@ -1125,7 +1125,7 @@ public function testConnectUserWithRoleAndPivotMetaByUsingConnect(): void
11251125
11261126 $ meta = Lorem::sentence ();
11271127
1128- $ this ->graphQL (/** @lang GraphQL */ '
1128+ $ this ->graphQL (/** @lang GraphQL */ <<<'GRAPHQL '
11291129 mutation ($meta: String) {
11301130 pivotsUpdateUser(input: {
11311131 id: 1,
@@ -1145,7 +1145,7 @@ public function testConnectUserWithRoleAndPivotMetaByUsingConnect(): void
11451145 }
11461146 }
11471147 }
1148- ' , [
1148+ GRAPHQL , [
11491149 'meta ' => $ meta ,
11501150 ])->assertJson ([
11511151 'data ' => [
0 commit comments