diff --git a/tests/php/GraphQL/Fake/FakeResolveInfo.php b/tests/php/GraphQL/Fake/FakeResolveInfo.php index 7d8601b5..d88df864 100644 --- a/tests/php/GraphQL/Fake/FakeResolveInfo.php +++ b/tests/php/GraphQL/Fake/FakeResolveInfo.php @@ -1,9 +1,12 @@ 'fake', 'type' => Type::string()]), + [], + new ObjectType(['name' => 'fake']), + [], + new Schema([]), + [], + '', + null, + [] + ); } } diff --git a/tests/php/GraphQL/Legacy/Extensions/ReadExtensionTest.php b/tests/php/GraphQL/Legacy/Extensions/ReadExtensionTest.php index 8478bed7..b3667a6a 100644 --- a/tests/php/GraphQL/Legacy/Extensions/ReadExtensionTest.php +++ b/tests/php/GraphQL/Legacy/Extensions/ReadExtensionTest.php @@ -3,7 +3,6 @@ namespace SilverStripe\Versioned\Tests\GraphQL\Legacy\Extensions; use GraphQL\Type\Definition\ObjectType; -use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\Dev\SapphireTest; use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\Resolvers\ApplyVersionFilters; @@ -13,6 +12,7 @@ use SilverStripe\Security\Member; use SilverStripe\Versioned\GraphQL\Types\VersionedInputType; use SilverStripe\Versioned\Tests\GraphQL\Fake\Fake; +use SilverStripe\Versioned\Tests\GraphQL\Fake\FakeResolveInfo; use SilverStripe\Core\Injector\Injector; // GraphQL dependency is optional in versioned, @@ -54,6 +54,6 @@ public function testReadExtensionAppliesFilters() $read->setUsePagination(false); $readScaffold = $read->scaffold($manager); $this->assertIsCallable($readScaffold['resolve']); - $readScaffold['resolve'](null, ['Versioning' => true], ['currentUser' => new Member()], new ResolveInfo([])); + $readScaffold['resolve'](null, ['Versioning' => true], ['currentUser' => new Member()], new FakeResolveInfo()); } } diff --git a/tests/php/GraphQL/Legacy/Extensions/ReadOneExtensionTest.php b/tests/php/GraphQL/Legacy/Extensions/ReadOneExtensionTest.php index 29802211..e385b95d 100644 --- a/tests/php/GraphQL/Legacy/Extensions/ReadOneExtensionTest.php +++ b/tests/php/GraphQL/Legacy/Extensions/ReadOneExtensionTest.php @@ -3,7 +3,6 @@ namespace SilverStripe\Versioned\Tests\GraphQL\Legacy\Extensions; use GraphQL\Type\Definition\ObjectType; -use GraphQL\Type\Definition\ResolveInfo; use InvalidArgumentException; use SilverStripe\Dev\SapphireTest; use SilverStripe\GraphQL\Manager; @@ -13,6 +12,7 @@ use SilverStripe\Security\Security; use SilverStripe\Versioned\GraphQL\Types\VersionedInputType; use SilverStripe\Versioned\Tests\GraphQL\Fake\Fake; +use SilverStripe\Versioned\Tests\GraphQL\Fake\FakeResolveInfo; use SilverStripe\Versioned\Versioned; // GraphQL dependency is optional in versioned, @@ -60,7 +60,7 @@ public function testReadOneExtensionAppliesFilters() null, $args, ['currentUser' => Security::getCurrentUser()], - new ResolveInfo([]) + new FakeResolveInfo() ); }; diff --git a/tests/php/GraphQL/Legacy/Operations/CopyToStageTest.php b/tests/php/GraphQL/Legacy/Operations/CopyToStageTest.php index 33e2b3b6..7d555c60 100644 --- a/tests/php/GraphQL/Legacy/Operations/CopyToStageTest.php +++ b/tests/php/GraphQL/Legacy/Operations/CopyToStageTest.php @@ -3,7 +3,6 @@ namespace SilverStripe\Versioned\Tests\GraphQL\Legacy\Operations; use GraphQL\Type\Definition\ObjectType; -use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\Dev\SapphireTest; use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\Scaffolding\StaticSchema; @@ -13,6 +12,7 @@ use SilverStripe\Versioned\GraphQL\Operations\CopyToStage; use SilverStripe\Versioned\GraphQL\Types\CopyToStageInputType; use SilverStripe\Versioned\Tests\GraphQL\Fake\Fake; +use SilverStripe\Versioned\Tests\GraphQL\Fake\FakeResolveInfo; use SilverStripe\Versioned\Versioned; use InvalidArgumentException; @@ -67,7 +67,7 @@ public function testCopyToStage() ], ], [ 'currentUser' => $member ], - new ResolveInfo([]) + new FakeResolveInfo() ); $recordLive = Versioned::get_by_stage(Fake::class, Versioned::LIVE) ->byID($record->ID); @@ -93,7 +93,7 @@ public function testCopyToStage() ], ], [ 'currentUser' => $member ], - new ResolveInfo([]) + new FakeResolveInfo() ); $recordLive = Versioned::get_by_stage(Fake::class, Versioned::LIVE) ->byID($record->ID); @@ -110,7 +110,7 @@ public function testCopyToStage() ], ], [ 'currentUser' => new Member() ], - new ResolveInfo([]) + new FakeResolveInfo() ); } } diff --git a/tests/php/GraphQL/Legacy/Operations/PublishTest.php b/tests/php/GraphQL/Legacy/Operations/PublishTest.php index adc6ad69..228a4d08 100644 --- a/tests/php/GraphQL/Legacy/Operations/PublishTest.php +++ b/tests/php/GraphQL/Legacy/Operations/PublishTest.php @@ -3,7 +3,6 @@ namespace SilverStripe\Versioned\Tests\GraphQL\Legacy\Operations; use GraphQL\Type\Definition\ObjectType; -use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\Dev\SapphireTest; use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\Scaffolding\StaticSchema; @@ -12,6 +11,7 @@ use SilverStripe\Security\Security; use SilverStripe\Versioned\GraphQL\Operations\Publish; use SilverStripe\Versioned\Tests\GraphQL\Fake\Fake; +use SilverStripe\Versioned\Tests\GraphQL\Fake\FakeResolveInfo; use SilverStripe\Versioned\Versioned; use Exception; @@ -63,7 +63,7 @@ public function testPublish() 'ID' => $record->ID ], [ 'currentUser' => $member ], - new ResolveInfo([]) + new FakeResolveInfo() ); $result = Versioned::get_by_stage(Fake::class, Versioned::LIVE) ->byID($record->ID); @@ -80,7 +80,7 @@ public function testPublish() 'ID' => $record->ID ], [ 'currentUser' => new Member() ], - new ResolveInfo([]) + new FakeResolveInfo() ); } } diff --git a/tests/php/GraphQL/Legacy/Operations/ReadVersionsTest.php b/tests/php/GraphQL/Legacy/Operations/ReadVersionsTest.php index 76497ead..911b4ff9 100644 --- a/tests/php/GraphQL/Legacy/Operations/ReadVersionsTest.php +++ b/tests/php/GraphQL/Legacy/Operations/ReadVersionsTest.php @@ -4,7 +4,6 @@ use Exception; use GraphQL\Type\Definition\ObjectType; -use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\Dev\SapphireTest; use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\Schema\Schema; @@ -15,6 +14,7 @@ use SilverStripe\Versioned\GraphQL\Types\VersionedStage; use SilverStripe\Versioned\GraphQL\Types\VersionSortType; use SilverStripe\Versioned\Tests\GraphQL\Fake\Fake; +use SilverStripe\Versioned\Tests\GraphQL\Fake\FakeResolveInfo; use SilverStripe\Versioned\Tests\VersionedTest\UnversionedWithField; // GraphQL dependency is optional in versioned, @@ -58,7 +58,7 @@ public function testItThrowsIfAppliedToAnUnversionedObject() new UnversionedWithField(), [], ['currentUser' => new Member()], - new ResolveInfo([]) + new FakeResolveInfo() ); } @@ -79,7 +79,7 @@ public function testItThrowsIfYouCantReadStages() new Fake(), [], ['currentUser' => new Member()], - new ResolveInfo([]) + new FakeResolveInfo() ); } @@ -110,7 +110,7 @@ public function testItReadsVersions() $record, [], ['currentUser' => $member], - new ResolveInfo([]) + new FakeResolveInfo() ); $this->assertInstanceOf(SS_List::class, $result); diff --git a/tests/php/GraphQL/Legacy/Operations/RollbackTest.php b/tests/php/GraphQL/Legacy/Operations/RollbackTest.php index abdc80eb..1585f9d7 100644 --- a/tests/php/GraphQL/Legacy/Operations/RollbackTest.php +++ b/tests/php/GraphQL/Legacy/Operations/RollbackTest.php @@ -3,7 +3,6 @@ namespace SilverStripe\Versioned\Tests\GraphQL\Legacy\Operations; use GraphQL\Type\Definition\ObjectType; -use GraphQL\Type\Definition\ResolveInfo; use InvalidArgumentException; use SilverStripe\Dev\SapphireTest; use SilverStripe\GraphQL\Manager; @@ -13,6 +12,7 @@ use SilverStripe\Security\Security; use SilverStripe\Versioned\GraphQL\Operations\Rollback; use SilverStripe\Versioned\Tests\GraphQL\Fake\FakeDataObjectStub; +use SilverStripe\Versioned\Tests\GraphQL\Fake\FakeResolveInfo; // GraphQL dependency is optional in versioned, // and this legacy implementation relies on existence of this class (in GraphQL v3) @@ -85,7 +85,7 @@ protected function doMutation(DataObject $stub, $toVersion = 1, $member = null) null, $args, [ 'currentUser' => $member ?: Security::getCurrentUser() ], - new ResolveInfo([]) + new FakeResolveInfo() ); } } diff --git a/tests/php/GraphQL/Legacy/Operations/UnpublishTest.php b/tests/php/GraphQL/Legacy/Operations/UnpublishTest.php index d3dafbca..86600452 100644 --- a/tests/php/GraphQL/Legacy/Operations/UnpublishTest.php +++ b/tests/php/GraphQL/Legacy/Operations/UnpublishTest.php @@ -3,7 +3,6 @@ namespace SilverStripe\Versioned\Tests\GraphQL\Legacy\Operations; use GraphQL\Type\Definition\ObjectType; -use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\Dev\SapphireTest; use SilverStripe\GraphQL\Manager; use SilverStripe\GraphQL\Scaffolding\StaticSchema; @@ -12,6 +11,7 @@ use SilverStripe\Security\Security; use SilverStripe\Versioned\GraphQL\Operations\Unpublish; use SilverStripe\Versioned\Tests\GraphQL\Fake\Fake; +use SilverStripe\Versioned\Tests\GraphQL\Fake\FakeResolveInfo; use SilverStripe\Versioned\Versioned; use Exception; @@ -67,7 +67,7 @@ public function testPublish() 'ID' => $record->ID ], [ 'currentUser' => $member ], - new ResolveInfo([]) + new FakeResolveInfo() ); $result = Versioned::get_by_stage(Fake::class, Versioned::LIVE) ->byID($record->ID); @@ -83,7 +83,7 @@ public function testPublish() 'ID' => $record->ID ], [ 'currentUser' => new Member() ], - new ResolveInfo([]) + new FakeResolveInfo() ); } }