diff --git a/tests/php/GraphQL/CreateFolderMutationCreatorTest.php b/tests/php/GraphQL/CreateFolderMutationCreatorTest.php index 97572768c..b5214ad00 100644 --- a/tests/php/GraphQL/CreateFolderMutationCreatorTest.php +++ b/tests/php/GraphQL/CreateFolderMutationCreatorTest.php @@ -8,9 +8,9 @@ use SilverStripe\Assets\File; use SilverStripe\Assets\Folder; use SilverStripe\Dev\SapphireTest; -use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\GraphQL\Schema\Schema; use SilverStripe\Versioned\Tests\GraphQL\Fake\Fake; +use SilverStripe\AssetAdmin\Tests\GraphQL\FakeResolveInfo; class CreateFolderMutationCreatorTest extends SapphireTest { diff --git a/tests/php/GraphQL/FakeResolveInfo.php b/tests/php/GraphQL/FakeResolveInfo.php index e8606f181..21e8bd346 100644 --- a/tests/php/GraphQL/FakeResolveInfo.php +++ b/tests/php/GraphQL/FakeResolveInfo.php @@ -1,13 +1,32 @@ 'fake', 'type' => Type::string()]), + [], + new ObjectType(['name' => 'fake']), + [], + new Schema([]), + [], + '', + null, + [] + ); } } diff --git a/tests/php/GraphQL/FolderTypeCreatorTest.php b/tests/php/GraphQL/FolderTypeCreatorTest.php index 6d48a31d7..3d11a299b 100644 --- a/tests/php/GraphQL/FolderTypeCreatorTest.php +++ b/tests/php/GraphQL/FolderTypeCreatorTest.php @@ -2,9 +2,9 @@ namespace SilverStripe\AssetAdmin\Tests\GraphQL; -use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\AssetAdmin\GraphQL\FolderTypeCreator; use SilverStripe\AssetAdmin\GraphQL\Resolvers\FolderTypeResolver; +use SilverStripe\AssetAdmin\Tests\GraphQL\FakeResolveInfo; use SilverStripe\Assets\File; use SilverStripe\Assets\Folder; use SilverStripe\Dev\SapphireTest; diff --git a/tests/php/GraphQL/Legacy/CreateFolderMutationCreatorTest.php b/tests/php/GraphQL/Legacy/CreateFolderMutationCreatorTest.php index cfe2a649d..560bf163c 100644 --- a/tests/php/GraphQL/Legacy/CreateFolderMutationCreatorTest.php +++ b/tests/php/GraphQL/Legacy/CreateFolderMutationCreatorTest.php @@ -4,6 +4,7 @@ use SilverStripe\AssetAdmin\Tests\Controller\AssetAdminTest\FileExtension; use SilverStripe\AssetAdmin\Tests\Controller\AssetAdminTest\FolderExtension; +use SilverStripe\AssetAdmin\Tests\GraphQL\FakeResolveInfo; use SilverStripe\Assets\File; use SilverStripe\Assets\Folder; use SilverStripe\Dev\SapphireTest; @@ -46,7 +47,7 @@ public function testItCreatesFolder() ] ]; $creator = new CreateFolderMutationCreator(); - $newFolder = $creator->resolve(null, $args, null, new ResolveInfo([])); + $newFolder = $creator->resolve(null, $args, null, new FakeResolveInfo()); $this->assertNotNull($newFolder); $this->assertEquals($folder1->ID, $newFolder->ParentID); $this->assertEquals('testItCreatesFolder', $newFolder->Name); @@ -65,6 +66,6 @@ public function testItRestrictsCreateFolderByCanCreate() ] ]; $creator = new CreateFolderMutationCreator(); - $creator->resolve(null, $args, null, new ResolveInfo([])); + $creator->resolve(null, $args, null, new FakeResolveInfo()); } } diff --git a/tests/php/GraphQL/Legacy/FolderTypeCreatorTest.php b/tests/php/GraphQL/Legacy/FolderTypeCreatorTest.php index 81426454e..e90b7fceb 100644 --- a/tests/php/GraphQL/Legacy/FolderTypeCreatorTest.php +++ b/tests/php/GraphQL/Legacy/FolderTypeCreatorTest.php @@ -3,6 +3,7 @@ namespace SilverStripe\AssetAdmin\Tests\Legacy\GraphQL; use GraphQL\Type\Definition\ResolveInfo; +use SilverStripe\AssetAdmin\Tests\GraphQL\FakeResolveInfo; use SilverStripe\AssetAdmin\GraphQL\FolderTypeCreator; use SilverStripe\Assets\File; use SilverStripe\Assets\Folder; @@ -130,7 +131,7 @@ public function testItShowsParents() $folder1_1_1, [], $this->getContext(), - new ResolveInfo([]) + new FakeResolveInfo() ); $this->assertEquals( [ @@ -165,7 +166,7 @@ protected function resolveChildrenConnection($object, $args, $context = null) $object, $args, $context, - new ResolveInfo([]), + new FakeResolveInfo(), $creator->getChildrenConnection() ); } diff --git a/tests/php/GraphQL/Legacy/ReadDescendantFileCountsQueryCreatorTest.php b/tests/php/GraphQL/Legacy/ReadDescendantFileCountsQueryCreatorTest.php index 3f7ce6dc8..2211d1257 100644 --- a/tests/php/GraphQL/Legacy/ReadDescendantFileCountsQueryCreatorTest.php +++ b/tests/php/GraphQL/Legacy/ReadDescendantFileCountsQueryCreatorTest.php @@ -5,10 +5,10 @@ use SilverStripe\AssetAdmin\GraphQL\ReadDescendantFileCountsQueryCreator; use SilverStripe\AssetAdmin\Tests\Controller\AssetAdminTest\FileExtension; use SilverStripe\AssetAdmin\Tests\Controller\AssetAdminTest\FolderExtension; +use SilverStripe\AssetAdmin\Tests\GraphQL\FakeResolveInfo; use SilverStripe\Assets\File; use SilverStripe\Assets\Folder; use SilverStripe\Dev\SapphireTest; -use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\GraphQL\Manager; use Silverstripe\Assets\Dev\TestAssetStore; use SilverStripe\GraphQL\Schema\Schema; @@ -78,7 +78,7 @@ protected function getResultsForSearch($args, $context = null) { $context = $context ? $context : ['currentUser' => null]; $creator = new ReadDescendantFileCountsQueryCreator(new Manager()); - return $creator->resolve(null, $args, $context, new ResolveInfo([])); + return $creator->resolve(null, $args, $context, new FakeResolveInfo()); } /** diff --git a/tests/php/GraphQL/Legacy/ReadFileQueryCreatorTest.php b/tests/php/GraphQL/Legacy/ReadFileQueryCreatorTest.php index f2b94a657..59e44fcfa 100644 --- a/tests/php/GraphQL/Legacy/ReadFileQueryCreatorTest.php +++ b/tests/php/GraphQL/Legacy/ReadFileQueryCreatorTest.php @@ -5,10 +5,10 @@ use SilverStripe\AssetAdmin\GraphQL\ReadFileQueryCreator; use SilverStripe\AssetAdmin\Tests\Controller\AssetAdminTest\FileExtension; use SilverStripe\AssetAdmin\Tests\Controller\AssetAdminTest\FolderExtension; +use SilverStripe\AssetAdmin\Tests\GraphQL\FakeResolveInfo; use SilverStripe\Assets\File; use SilverStripe\Assets\Folder; use SilverStripe\Dev\SapphireTest; -use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\GraphQL\Manager; use Silverstripe\Assets\Dev\TestAssetStore; use SilverStripe\GraphQL\Schema\Schema; @@ -90,6 +90,6 @@ protected function getResultsForSearch($args, $context = null) { $context = $context ? $context : ['currentUser' => null]; $creator = new ReadFileQueryCreator(new Manager()); - return $creator->resolveConnection(null, $args, $context, new ResolveInfo([])); + return $creator->resolveConnection(null, $args, $context, new FakeResolveInfo()); } } diff --git a/tests/php/GraphQL/Legacy/ReadFileUsageQueryCreatorTest.php b/tests/php/GraphQL/Legacy/ReadFileUsageQueryCreatorTest.php index d4e9f1ca9..276ef1c89 100644 --- a/tests/php/GraphQL/Legacy/ReadFileUsageQueryCreatorTest.php +++ b/tests/php/GraphQL/Legacy/ReadFileUsageQueryCreatorTest.php @@ -2,6 +2,7 @@ namespace SilverStripe\AssetAdmin\Tests\Legacy\GraphQL; +use SilverStripe\AssetAdmin\Tests\GraphQL\FakeResolveInfo; use SilverStripe\AssetAdmin\GraphQL\ReadFileQueryCreator; use SilverStripe\AssetAdmin\GraphQL\ReadFileUsageQueryCreator; use SilverStripe\AssetAdmin\Tests\Controller\AssetAdminTest\FileExtension; @@ -9,7 +10,6 @@ use SilverStripe\Assets\File; use SilverStripe\Assets\Folder; use SilverStripe\Dev\SapphireTest; -use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\GraphQL\Manager; use Silverstripe\Assets\Dev\TestAssetStore; use SilverStripe\GraphQL\Schema\Schema; @@ -84,7 +84,7 @@ protected function getResultsForSearch($args, $context = null) { $context = $context ? $context : ['currentUser' => null]; $creator = new ReadFileUsageQueryCreator(new Manager()); - return $creator->resolve(null, $args, $context, new ResolveInfo([])); + return $creator->resolve(null, $args, $context, new FakeResolveInfo()); } /** diff --git a/tests/php/GraphQL/Legacy/UnpublishFileMutationCreatorTest.php b/tests/php/GraphQL/Legacy/UnpublishFileMutationCreatorTest.php index 5fb1db584..18ed972ea 100644 --- a/tests/php/GraphQL/Legacy/UnpublishFileMutationCreatorTest.php +++ b/tests/php/GraphQL/Legacy/UnpublishFileMutationCreatorTest.php @@ -2,9 +2,9 @@ namespace SilverStripe\AssetAdmin\Tests\Legacy\GraphQL; -use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\AssetAdmin\GraphQL\Notice; use SilverStripe\AssetAdmin\GraphQL\UnpublishFileMutationCreator; +use SilverStripe\AssetAdmin\Tests\GraphQL\FakeResolveInfo; use SilverStripe\AssetAdmin\Tests\GraphQL\UnpublishFileMutationCreatorTest\FileOwner; use SilverStripe\Assets\File; use SilverStripe\Dev\SapphireTest; @@ -36,7 +36,7 @@ public function testUnpublishWithOwners() $member = Security::getCurrentUser(); $mutation = new UnpublishFileMutationCreator(); $context = ['currentUser' => $member]; - $resolveInfo = new ResolveInfo([]); + $resolveInfo = new FakeResolveInfo(); /** @var File $file */ $file = $this->objFromFixture(File::class, 'file1');