Skip to content

Commit 1486af8

Browse files
committed
Merge branch '2.3'
2 parents deeaf29 + 67aa2a0 commit 1486af8

File tree

8 files changed

+118
-12
lines changed

8 files changed

+118
-12
lines changed

features/graphql/query.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@ Feature: GraphQL query support
124124
And the header "Content-Type" should be equal to "application/json"
125125
And the JSON node "data.dummyGroup.foo" should be equal to "Foo #1"
126126

127+
Scenario: Fetch only the internal id
128+
When I send the following GraphQL request:
129+
"""
130+
{
131+
dummy(id: "/dummies/1") {
132+
_id
133+
}
134+
}
135+
"""
136+
Then the response status code should be 200
137+
And the response should be in JSON
138+
And the header "Content-Type" should be equal to "application/json"
139+
And the JSON node "data.dummy._id" should be equal to "1"
140+
127141
@dropSchema
128142
Scenario: Retrieve an nonexistent item through a GraphQL query
129143
When I send the following GraphQL request:

src/Bridge/Doctrine/Orm/Extension/EagerLoadingExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ private function joinRelations(QueryBuilder $queryBuilder, QueryNameGeneratorInt
232232

233233
$this->joinRelations($queryBuilder, $queryNameGenerator, $mapping['targetEntity'], $forceEager, $fetchPartial, $associationAlias, $options, $normalizationContext, 'leftJoin' === $method, $joinCount, $currentDepth);
234234
}
235+
236+
// result is discarded (this is just re-hydrating the collections) see http://ocramius.github.io/blog/doctrine-orm-optimization-hydration/
237+
$queryBuilder->getQuery()->getResult();
235238
}
236239

237240
private function addSelect(QueryBuilder $queryBuilder, string $entity, string $associationAlias, array $propertyMetadataOptions)

src/GraphQl/Resolver/Factory/CollectionResolverFactory.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use ApiPlatform\Core\DataProvider\PaginatorInterface;
1919
use ApiPlatform\Core\DataProvider\SubresourceDataProviderInterface;
2020
use ApiPlatform\Core\Exception\ResourceClassNotSupportedException;
21+
use ApiPlatform\Core\GraphQl\Resolver\FieldsToAttributesTrait;
2122
use ApiPlatform\Core\GraphQl\Resolver\ResourceAccessCheckerTrait;
2223
use ApiPlatform\Core\GraphQl\Serializer\ItemNormalizer;
2324
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
@@ -37,6 +38,7 @@
3738
*/
3839
final class CollectionResolverFactory implements ResolverFactoryInterface
3940
{
41+
use FieldsToAttributesTrait;
4042
use ResourceAccessCheckerTrait;
4143

4244
private $collectionDataProvider;
@@ -125,16 +127,6 @@ public function __invoke(string $resourceClass = null, string $rootClass = null,
125127
};
126128
}
127129

128-
private function fieldsToAttributes(ResolveInfo $info): array
129-
{
130-
$fields = $info->getFieldSelection(PHP_INT_MAX);
131-
if (isset($fields['edges']['node'])) {
132-
$fields = $fields['edges']['node'];
133-
}
134-
135-
return $fields;
136-
}
137-
138130
/**
139131
* @throws ResourceClassNotSupportedException
140132
*

src/GraphQl/Resolver/Factory/ItemMutationResolverFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use ApiPlatform\Core\DataPersister\DataPersisterInterface;
1818
use ApiPlatform\Core\Exception\InvalidArgumentException;
1919
use ApiPlatform\Core\Exception\ItemNotFoundException;
20+
use ApiPlatform\Core\GraphQl\Resolver\FieldsToAttributesTrait;
2021
use ApiPlatform\Core\GraphQl\Resolver\ResourceAccessCheckerTrait;
2122
use ApiPlatform\Core\GraphQl\Serializer\ItemNormalizer;
2223
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
@@ -38,6 +39,7 @@
3839
*/
3940
final class ItemMutationResolverFactory implements ResolverFactoryInterface
4041
{
42+
use FieldsToAttributesTrait;
4143
use ResourceAccessCheckerTrait;
4244

4345
private $iriConverter;
@@ -73,7 +75,7 @@ public function __invoke(string $resourceClass = null, string $rootClass = null,
7375

7476
$resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
7577
$normalizationContext = $resourceMetadata->getGraphqlAttribute($operationName ?? '', 'normalization_context', [], true);
76-
$normalizationContext['attributes'] = $info->getFieldSelection(PHP_INT_MAX);
78+
$normalizationContext['attributes'] = $this->fieldsToAttributes($info);
7779

7880
if (isset($args['input']['id'])) {
7981
try {
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace ApiPlatform\Core\GraphQl\Resolver;
15+
16+
use GraphQL\Type\Definition\ResolveInfo;
17+
18+
/**
19+
* Transforms the passed GraphQL fields to the list of attributes to serialize.
20+
*
21+
* @author Kévin Dunglas <[email protected]>
22+
*/
23+
trait FieldsToAttributesTrait
24+
{
25+
/**
26+
* Retrieves fields, recursively replaces the "_id" key (the raw id) by "id" (the name of the property expected by the Serializer) and flattens edge and node structures (pagination).
27+
*/
28+
private function fieldsToAttributes(ResolveInfo $info): array
29+
{
30+
$fields = $info->getFieldSelection(PHP_INT_MAX);
31+
if (isset($fields['edges']['node'])) {
32+
$fields = $fields['edges']['node'];
33+
}
34+
35+
return $this->replaceIdKeys($fields);
36+
}
37+
38+
private function replaceIdKeys(array $fields): array
39+
{
40+
foreach ($fields as $key => $value) {
41+
if ('_id' === $key) {
42+
$fields['id'] = $fields['_id'];
43+
unset($fields['_id']);
44+
} elseif (\is_array($fields[$key])) {
45+
$fields[$key] = $this->replaceIdKeys($fields[$key]);
46+
}
47+
}
48+
49+
return $fields;
50+
}
51+
}

src/GraphQl/Resolver/ItemResolver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
final class ItemResolver
3434
{
3535
use ClassInfoTrait;
36+
use FieldsToAttributesTrait;
3637
use ResourceAccessCheckerTrait;
3738

3839
private $iriConverter;
@@ -59,7 +60,7 @@ public function __invoke($source, $args, $context, ResolveInfo $info)
5960
return null;
6061
}
6162

62-
$baseNormalizationContext = ['attributes' => $info->getFieldSelection(PHP_INT_MAX)];
63+
$baseNormalizationContext = ['attributes' => $this->fieldsToAttributes($info)];
6364
try {
6465
$item = $this->iriConverter->getItemFromIri($args['id'], $baseNormalizationContext);
6566
} catch (ItemNotFoundException $e) {

tests/Action/ExceptionActionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
/**
2626
* @author Amrouche Hamza <[email protected]>
2727
* @author Baptiste Meyer <[email protected]>
28+
*
29+
* @group time-sensitive
2830
*/
2931
class ExceptionActionTest extends TestCase
3032
{

tests/Bridge/Doctrine/Orm/Extension/EagerLoadingExtensionTest.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\EmbeddableDummy;
3232
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\RelatedDummy;
3333
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\UnknownDummy;
34+
use Doctrine\ORM\AbstractQuery;
3435
use Doctrine\ORM\EntityManager;
3536
use Doctrine\ORM\Mapping\ClassMetadata;
3637
use Doctrine\ORM\Mapping\ClassMetadataInfo;
@@ -122,6 +123,9 @@ public function testApplyToCollection()
122123
$queryBuilderProphecy->addSelect('partial relatedDummy_a1.{id,name,embeddedDummy.name}')->shouldBeCalled(1);
123124
$queryBuilderProphecy->addSelect('partial relatedDummy2_a2.{id,name,embeddedDummy.name}')->shouldBeCalled(1);
124125

126+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
127+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(3);
128+
125129
$queryBuilder = $queryBuilderProphecy->reveal();
126130
$eagerExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, false, null, null, true);
127131
$eagerExtensionTest->applyToCollection($queryBuilder, new QueryNameGenerator(), Dummy::class, null, $context);
@@ -228,6 +232,9 @@ public function testApplyToItem()
228232
$queryBuilderProphecy->addSelect('partial relatedDummy4_a5.{id}')->shouldBeCalled(1);
229233
$queryBuilderProphecy->addSelect('singleInheritanceRelation_a6')->shouldBeCalled(1);
230234

235+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
236+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(7);
237+
231238
$queryBuilder = $queryBuilderProphecy->reveal();
232239
$orderExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, false, null, null, true);
233240

@@ -253,6 +260,8 @@ public function testCreateItemWithOperationName()
253260
$emProphecy->getClassMetadata(Dummy::class)->shouldBeCalled()->willReturn($classMetadataProphecy->reveal());
254261
$queryBuilderProphecy->getRootAliases()->willReturn(['o']);
255262
$queryBuilderProphecy->getEntityManager()->willReturn($emProphecy);
263+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
264+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(1);
256265

257266
$orderExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, false, null, null, true);
258267
$orderExtensionTest->applyToItem($queryBuilderProphecy->reveal(), new QueryNameGenerator(), Dummy::class, [], 'item_operation', ['groups' => ['foo']]);
@@ -277,6 +286,8 @@ public function testCreateCollectionWithOperationName()
277286
$emProphecy->getClassMetadata(Dummy::class)->shouldBeCalled()->willReturn($classMetadataProphecy->reveal());
278287
$queryBuilderProphecy->getRootAliases()->willReturn(['o']);
279288
$queryBuilderProphecy->getEntityManager()->willReturn($emProphecy);
289+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
290+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(1);
280291

281292
$eagerExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, false, null, null, true);
282293
$eagerExtensionTest->applyToCollection($queryBuilderProphecy->reveal(), new QueryNameGenerator(), Dummy::class, 'collection_operation', ['groups' => ['foo']]);
@@ -300,6 +311,8 @@ public function testDenormalizeItemWithCorrectResourceClass()
300311
$queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
301312
$queryBuilderProphecy->getRootAliases()->willReturn(['o']);
302313
$queryBuilderProphecy->getEntityManager()->willReturn($emProphecy);
314+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
315+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(1);
303316

304317
$eagerExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, false, null, null, true);
305318
$eagerExtensionTest->applyToItem($queryBuilderProphecy->reveal(), new QueryNameGenerator(), RelatedDummy::class, ['id' => 1], 'item_operation', ['resource_class' => Dummy::class]);
@@ -322,6 +335,8 @@ public function testDenormalizeItemWithExistingGroups()
322335
$queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
323336
$queryBuilderProphecy->getRootAliases()->willReturn(['o']);
324337
$queryBuilderProphecy->getEntityManager()->willReturn($emProphecy);
338+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
339+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(1);
325340

326341
$eagerExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, false, null, null, true);
327342
$eagerExtensionTest->applyToItem($queryBuilderProphecy->reveal(), new QueryNameGenerator(), RelatedDummy::class, ['id' => 1], 'item_operation', [AbstractNormalizer::GROUPS => 'some_groups']);
@@ -442,6 +457,8 @@ public function testMaxDepth()
442457

443458
$queryBuilderProphecy->innerJoin(Argument::type('string'), Argument::type('string'))->shouldBeCalledTimes(2);
444459
$queryBuilderProphecy->addSelect(Argument::type('string'))->shouldBeCalled();
460+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
461+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(3);
445462

446463
$eagerExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, false, null, null, true, $classMetadataFactoryProphecy->reveal());
447464
$eagerExtensionTest->applyToCollection($queryBuilderProphecy->reveal(), new QueryNameGenerator(), Dummy::class);
@@ -487,6 +504,9 @@ public function testForceEager()
487504
$queryBuilderProphecy->getRootAliases()->willReturn(['o']);
488505
$queryBuilderProphecy->getEntityManager()->willReturn($emProphecy);
489506

507+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
508+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(2);
509+
490510
$orderExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, true, null, null, true);
491511
$orderExtensionTest->applyToItem($queryBuilderProphecy->reveal(), new QueryNameGenerator(), Dummy::class, []);
492512
}
@@ -523,6 +543,9 @@ public function testExtraLazy()
523543
$queryBuilderProphecy->getRootAliases()->willReturn(['o']);
524544
$queryBuilderProphecy->getEntityManager()->willReturn($emProphecy);
525545

546+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
547+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(1);
548+
526549
$orderExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, true, null, null, true);
527550
$orderExtensionTest->applyToItem($queryBuilderProphecy->reveal(), new QueryNameGenerator(), Dummy::class, []);
528551
}
@@ -546,6 +569,8 @@ public function testResourceClassNotFoundException()
546569
$queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
547570
$queryBuilderProphecy->getRootAliases()->willReturn(['o']);
548571
$queryBuilderProphecy->getEntityManager()->willReturn($emProphecy);
572+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
573+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(1);
549574

550575
$orderExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, true, null, null, true);
551576
$orderExtensionTest->applyToItem($queryBuilderProphecy->reveal(), new QueryNameGenerator(), Dummy::class, [], null);
@@ -570,6 +595,8 @@ public function testPropertyNotFoundException()
570595
$queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
571596
$queryBuilderProphecy->getRootAliases()->willReturn(['o']);
572597
$queryBuilderProphecy->getEntityManager()->willReturn($emProphecy);
598+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
599+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(1);
573600

574601
$orderExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, true, null, null, true);
575602
$orderExtensionTest->applyToItem($queryBuilderProphecy->reveal(), new QueryNameGenerator(), Dummy::class, []);
@@ -599,6 +626,8 @@ public function testResourceClassNotFoundExceptionPropertyNameCollection()
599626
$queryBuilderProphecy->getRootAliases()->willReturn(['o']);
600627
$queryBuilderProphecy->getEntityManager()->willReturn($emProphecy);
601628
$queryBuilderProphecy->innerJoin('o.relation', 'relation_a1')->shouldBeCalled(1);
629+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
630+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(1);
602631

603632
$orderExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30, true, null, null, true);
604633
$orderExtensionTest->applyToItem($queryBuilderProphecy->reveal(), new QueryNameGenerator(), Dummy::class, []);
@@ -654,6 +683,8 @@ public function testApplyToCollectionWithSerializerContextBuilder()
654683

655684
$queryBuilderProphecy->leftJoin('o.relatedDummy', 'relatedDummy_a1')->shouldBeCalled(1);
656685
$queryBuilderProphecy->addSelect('partial relatedDummy_a1.{id,name}')->shouldBeCalled(1);
686+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
687+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(2);
657688

658689
$request = Request::create('/api/dummies', 'GET', []);
659690

@@ -718,6 +749,8 @@ public function testAttributes()
718749

719750
$queryBuilderProphecy->leftJoin('o.relatedDummy', 'relatedDummy_a1')->shouldBeCalled(1);
720751
$queryBuilderProphecy->addSelect('partial relatedDummy_a1.{id,name}')->shouldBeCalled(1);
752+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
753+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(2);
721754

722755
$request = Request::create('/api/dummies', 'GET', []);
723756

@@ -759,6 +792,8 @@ public function testNotInAttributes()
759792

760793
$queryBuilderProphecy->getRootAliases()->willReturn(['o']);
761794
$queryBuilderProphecy->getEntityManager()->willReturn($emProphecy);
795+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
796+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(1);
762797

763798
$request = Request::create('/api/dummies', 'GET', []);
764799

@@ -808,6 +843,8 @@ public function testApplyToCollectionNoPartial()
808843
$queryBuilderProphecy->innerJoin('o.relatedDummy2', 'relatedDummy2_a2')->shouldBeCalled(1);
809844
$queryBuilderProphecy->addSelect('relatedDummy_a1')->shouldBeCalled(1);
810845
$queryBuilderProphecy->addSelect('relatedDummy2_a2')->shouldBeCalled(1);
846+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
847+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(3);
811848

812849
$queryBuilder = $queryBuilderProphecy->reveal();
813850
$eagerExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30);
@@ -864,6 +901,8 @@ private function doTestApplyToCollectionWithANonRedableButFetchEagerProperty(boo
864901
$queryBuilderProphecy->innerJoin('o.relatedDummy2', 'relatedDummy2_a2')->shouldBeCalled(1);
865902
$queryBuilderProphecy->addSelect('relatedDummy_a1')->shouldBeCalled(1);
866903
$queryBuilderProphecy->addSelect('relatedDummy2_a2')->shouldBeCalled(1);
904+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
905+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(3);
867906

868907
$queryBuilder = $queryBuilderProphecy->reveal();
869908
$eagerExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30);
@@ -918,6 +957,8 @@ private function doTestApplyToCollectionWithARedableButNotFetchEagerProperty(boo
918957
$queryBuilderProphecy->innerJoin('o.relatedDummy2', 'relatedDummy2_a2')->shouldNotBeCalled();
919958
$queryBuilderProphecy->addSelect('relatedDummy_a1')->shouldNotBeCalled();
920959
$queryBuilderProphecy->addSelect('relatedDummy2_a2')->shouldNotBeCalled();
960+
$queryAbstractProphecy = $this->prophesize(AbstractQuery::class);
961+
$queryBuilderProphecy->getQuery()->willReturn($queryAbstractProphecy)->shouldBeCalledTimes(1);
921962

922963
$queryBuilder = $queryBuilderProphecy->reveal();
923964
$eagerExtensionTest = new EagerLoadingExtension($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), 30);

0 commit comments

Comments
 (0)