Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Doctrine/Orm/Tests/State/CollectionProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function testCannotCreateQueryBuilder(): void

public function testHandleLinksCallable(): void
{
$class = 'foo';
$class = \stdClass::class;
$resourceMetadata = $this->createStub(ResourceMetadataCollectionFactoryInterface::class);
$query = $this->createStub($this->getQueryClass());
$query->method('getResult')->willReturn([]);
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Orm/Tests/State/ItemProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class_exists(ManyToOneAssociationMapping::class) ?

public function testHandleLinksCallable(): void
{
$class = 'foo';
$class = \stdClass::class;
$resourceMetadata = $this->createStub(ResourceMetadataCollectionFactoryInterface::class);
$query = $this->createStub($this->getQueryClass());
$query->method('getOneOrNullResult')->willReturn(null);
Expand Down
64 changes: 32 additions & 32 deletions src/GraphQl/Tests/State/Processor/NormalizeProcessorTest.php

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/GraphQl/Tests/State/Provider/DenormalizeProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public function testProvide(): void
{
$objectToPopulate = null;
$context = ['args' => ['input' => ['test']]];
$operation = new Mutation(class: 'dummy');
$operation = new Mutation(class: \stdClass::class);
$serializerContext = ['resource_class' => $operation->getClass()];
$decorated = $this->createMock(ProviderInterface::class);
$decorated->expects($this->once())->method('provide')->willReturn($objectToPopulate);
$denormalizer = $this->createMock(DenormalizerInterface::class);
$serializerContextBuilder = $this->createMock(SerializerContextBuilderInterface::class);
$serializerContextBuilder->expects($this->once())->method('create')->with($operation->getClass(), $operation, $context, false)->willReturn($serializerContext);
$denormalizer->expects($this->once())->method('denormalize')->with(['test'], 'dummy', 'graphql', $serializerContext)->willReturn(new \stdClass());
$denormalizer->expects($this->once())->method('denormalize')->with(['test'], \stdClass::class, 'graphql', $serializerContext)->willReturn(new \stdClass());
$provider = new DenormalizeProvider($decorated, $denormalizer, $serializerContextBuilder);
$provider->provide($operation, [], $context);
}
Expand All @@ -43,14 +43,14 @@ public function testProvideWithObjectToPopulate(): void
{
$objectToPopulate = new \stdClass();
$context = ['args' => ['input' => ['test']]];
$operation = new Mutation(class: 'dummy');
$operation = new Mutation(class: \stdClass::class);
$serializerContext = ['resource_class' => $operation->getClass(), 'object_to_populate' => $objectToPopulate];
$decorated = $this->createMock(ProviderInterface::class);
$decorated->expects($this->once())->method('provide')->willReturn($objectToPopulate);
$denormalizer = $this->createMock(DenormalizerInterface::class);
$serializerContextBuilder = $this->createMock(SerializerContextBuilderInterface::class);
$serializerContextBuilder->expects($this->once())->method('create')->with($operation->getClass(), $operation, $context, false)->willReturn($serializerContext);
$denormalizer->expects($this->once())->method('denormalize')->with(['test'], 'dummy', 'graphql', $serializerContext)->willReturn(new \stdClass());
$denormalizer->expects($this->once())->method('denormalize')->with(['test'], \stdClass::class, 'graphql', $serializerContext)->willReturn(new \stdClass());
$provider = new DenormalizeProvider($decorated, $denormalizer, $serializerContextBuilder);
$provider->provide($operation, [], $context);
}
Expand All @@ -59,14 +59,14 @@ public function testProvideNotCalledWithQuery(): void
{
$objectToPopulate = new \stdClass();
$context = ['args' => ['input' => ['test']]];
$operation = new Query(class: 'dummy');
$operation = new Query(class: \stdClass::class);
$serializerContext = ['resource_class' => $operation->getClass()];
$decorated = $this->createMock(ProviderInterface::class);
$decorated->expects($this->once())->method('provide')->willReturn($objectToPopulate);
$denormalizer = $this->createMock(DenormalizerInterface::class);
$serializerContextBuilder = $this->createMock(SerializerContextBuilderInterface::class);
$serializerContextBuilder->expects($this->never())->method('create')->with($operation->getClass(), $operation, $context, false)->willReturn($serializerContext);
$denormalizer->expects($this->never())->method('denormalize')->with(['test'], 'dummy', 'graphql', $serializerContext)->willReturn(new \stdClass());
$denormalizer->expects($this->never())->method('denormalize')->with(['test'], \stdClass::class, 'graphql', $serializerContext)->willReturn(new \stdClass());
$provider = new DenormalizeProvider($decorated, $denormalizer, $serializerContextBuilder);
$provider->provide($operation, [], $context);
}
Expand All @@ -75,14 +75,14 @@ public function testProvideNotCalledWithoutDeserialize(): void
{
$objectToPopulate = new \stdClass();
$context = ['args' => ['input' => ['test']]];
$operation = new Query(class: 'dummy', deserialize: false);
$operation = new Query(class: \stdClass::class, deserialize: false);
$serializerContext = ['resource_class' => $operation->getClass()];
$decorated = $this->createMock(ProviderInterface::class);
$decorated->expects($this->once())->method('provide')->willReturn($objectToPopulate);
$denormalizer = $this->createMock(DenormalizerInterface::class);
$serializerContextBuilder = $this->createMock(SerializerContextBuilderInterface::class);
$serializerContextBuilder->expects($this->never())->method('create')->with($operation->getClass(), $operation, $context, false)->willReturn($serializerContext);
$denormalizer->expects($this->never())->method('denormalize')->with(['test'], 'dummy', 'graphql', $serializerContext)->willReturn(new \stdClass());
$denormalizer->expects($this->never())->method('denormalize')->with(['test'], \stdClass::class, 'graphql', $serializerContext)->willReturn(new \stdClass());
$provider = new DenormalizeProvider($decorated, $denormalizer, $serializerContextBuilder);
$provider->provide($operation, [], $context);
}
Expand Down
8 changes: 4 additions & 4 deletions src/GraphQl/Tests/State/Provider/ReadProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ReadProviderTest extends TestCase
public function testProvide(): void
{
$context = ['args' => ['id' => '/dummy/1']];
$operation = new Query(class: 'dummy');
$operation = new Query(class: \stdClass::class);
$decorated = $this->createMock(ProviderInterface::class);
$iriConverter = $this->createMock(IriConverterInterface::class);
$iriConverter->expects($this->once())->method('getResourceFromIri')->with('/dummy/1');
Expand All @@ -45,7 +45,7 @@ public function testProvide(): void
public function testProvideNotExistedResource(): void
{
$context = ['args' => ['id' => '/dummy/1']];
$operation = new Query(class: 'dummy');
$operation = new Query(class: \stdClass::class);
$decorated = $this->createMock(ProviderInterface::class);
$iriConverter = $this->createMock(IriConverterInterface::class);
$iriConverter->expects($this->once())->method('getResourceFromIri')->with('/dummy/1');
Expand All @@ -61,8 +61,8 @@ public function testProvideCollection(): void
{
$info = $this->createMock(ResolveInfo::class);
$info->fieldName = '';
$context = ['root_class' => 'dummy', 'source' => [], 'info' => $info, 'filters' => []];
$operation = new QueryCollection(class: 'dummy');
$context = ['root_class' => \stdClass::class, 'source' => [], 'info' => $info, 'filters' => []];
$operation = new QueryCollection(class: \stdClass::class);
$decorated = $this->createMock(ProviderInterface::class);
$decorated->expects($this->once())->method('provide')->with($operation, [], ['a'] + $context);
$iriConverter = $this->createMock(IriConverterInterface::class);
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQl/Tests/State/Provider/ResolverProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ResolverProviderTest extends TestCase
public function testProvide(): void
{
$res = new \stdClass();
$operation = new QueryCollection(class: 'dummy', resolver: 'foo');
$operation = new QueryCollection(class: \stdClass::class, resolver: 'foo');
$context = [];
$decorated = $this->createMock(ProviderInterface::class);
$resolverMock = $this->createMock(QueryItemResolverInterface::class);
Expand Down
Loading
Loading