3131use Doctrine \Common \Persistence \ObjectRepository ;
3232use Doctrine \DBAL \Connection ;
3333use Doctrine \DBAL \Platforms \AbstractPlatform ;
34+ use Doctrine \DBAL \Types \Type as DBALType ;
3435use Doctrine \ORM \AbstractQuery ;
3536use Doctrine \ORM \EntityManager ;
3637use Doctrine \ORM \EntityRepository ;
@@ -123,7 +124,7 @@ public function testGetSubresource()
123124
124125 $ identifiers = ['id ' ];
125126 $ queryBuilder = $ this ->prophesize (QueryBuilder::class);
126- $ queryBuilder ->setParameter ('id_p1 ' , 1 )->shouldBeCalled ()->willReturn ($ queryBuilder );
127+ $ queryBuilder ->setParameter ('id_p1 ' , 1 , DBALType:: INTEGER )->shouldBeCalled ()->willReturn ($ queryBuilder );
127128 $ funcProphecy = $ this ->prophesize (Func::class);
128129 $ func = $ funcProphecy ->reveal ();
129130
@@ -141,6 +142,7 @@ public function testGetSubresource()
141142 $ classMetadataProphecy = $ this ->prophesize (ClassMetadata::class);
142143 $ classMetadataProphecy ->hasAssociation ('relatedDummies ' )->willReturn (true )->shouldBeCalled ();
143144 $ classMetadataProphecy ->getAssociationMapping ('relatedDummies ' )->shouldBeCalled ()->willReturn (['type ' => ClassMetadata::MANY_TO_MANY ]);
145+ $ classMetadataProphecy ->getTypeOfField ('id ' )->willReturn (DBALType::INTEGER )->shouldBeCalled ();
144146
145147 $ managerProphecy ->getClassMetadata (Dummy::class)->shouldBeCalled ()->willReturn ($ classMetadataProphecy ->reveal ());
146148
@@ -199,6 +201,7 @@ public function testGetSubSubresourceItem()
199201 $ classMetadataProphecy = $ this ->prophesize (ClassMetadata::class);
200202 $ classMetadataProphecy ->hasAssociation ('relatedDummies ' )->willReturn (true )->shouldBeCalled ();
201203 $ classMetadataProphecy ->getAssociationMapping ('relatedDummies ' )->shouldBeCalled ()->willReturn (['type ' => ClassMetadata::MANY_TO_MANY ]);
204+ $ classMetadataProphecy ->getTypeOfField ('id ' )->willReturn (DBALType::INTEGER )->shouldBeCalled ();
202205
203206 $ dummyManagerProphecy = $ this ->prophesize (EntityManager::class);
204207 $ dummyManagerProphecy ->createQueryBuilder ()->shouldBeCalled ()->willReturn ($ qb ->reveal ());
@@ -225,6 +228,7 @@ public function testGetSubSubresourceItem()
225228 $ rClassMetadataProphecy = $ this ->prophesize (ClassMetadata::class);
226229 $ rClassMetadataProphecy ->hasAssociation ('thirdLevel ' )->shouldBeCalled ()->willReturn (true );
227230 $ rClassMetadataProphecy ->getAssociationMapping ('thirdLevel ' )->shouldBeCalled ()->willReturn (['type ' => ClassMetadata::MANY_TO_ONE ]);
231+ $ rClassMetadataProphecy ->getTypeOfField ('id ' )->willReturn (DBALType::INTEGER )->shouldBeCalled ();
228232
229233 $ rDummyManagerProphecy = $ this ->prophesize (EntityManager::class);
230234 $ rDummyManagerProphecy ->createQueryBuilder ()->shouldBeCalled ()->willReturn ($ rqb ->reveal ());
@@ -243,8 +247,8 @@ public function testGetSubSubresourceItem()
243247 $ queryBuilder ->andWhere ($ func )->shouldBeCalled ()->willReturn ($ queryBuilder );
244248
245249 $ queryBuilder ->getQuery ()->shouldBeCalled ()->willReturn ($ queryProphecy ->reveal ());
246- $ queryBuilder ->setParameter ('id_p1 ' , 1 )->shouldBeCalled ()->willReturn ($ queryBuilder );
247- $ queryBuilder ->setParameter ('id_p2 ' , 1 )->shouldBeCalled ()->willReturn ($ queryBuilder );
250+ $ queryBuilder ->setParameter ('id_p1 ' , 1 , DBALType:: INTEGER )->shouldBeCalled ()->willReturn ($ queryBuilder );
251+ $ queryBuilder ->setParameter ('id_p2 ' , 1 , DBALType:: INTEGER )->shouldBeCalled ()->willReturn ($ queryBuilder );
248252
249253 $ repositoryProphecy = $ this ->prophesize (EntityRepository::class);
250254 $ repositoryProphecy ->createQueryBuilder ('o ' )->shouldBeCalled ()->willReturn ($ queryBuilder ->reveal ());
@@ -269,7 +273,7 @@ public function testQueryResultExtension()
269273
270274 $ identifiers = ['id ' ];
271275 $ queryBuilder = $ this ->prophesize (QueryBuilder::class);
272- $ queryBuilder ->setParameter ('id_p1 ' , 1 )->shouldBeCalled ()->willReturn ($ queryBuilder );
276+ $ queryBuilder ->setParameter ('id_p1 ' , 1 , DBALType:: INTEGER )->shouldBeCalled ()->willReturn ($ queryBuilder );
273277 $ funcProphecy = $ this ->prophesize (Func::class);
274278 $ func = $ funcProphecy ->reveal ();
275279
@@ -285,6 +289,7 @@ public function testQueryResultExtension()
285289 $ classMetadataProphecy = $ this ->prophesize (ClassMetadata::class);
286290 $ classMetadataProphecy ->hasAssociation ('relatedDummies ' )->willReturn (true )->shouldBeCalled ();
287291 $ classMetadataProphecy ->getAssociationMapping ('relatedDummies ' )->shouldBeCalled ()->willReturn (['type ' => ClassMetadata::MANY_TO_MANY ]);
292+ $ classMetadataProphecy ->getTypeOfField ('id ' )->willReturn (DBALType::INTEGER )->shouldBeCalled ();
288293
289294 $ managerProphecy ->getClassMetadata (Dummy::class)->shouldBeCalled ()->willReturn ($ classMetadataProphecy ->reveal ());
290295 $ this ->assertIdentifierManagerMethodCalls ($ managerProphecy );
@@ -386,9 +391,9 @@ public function testGetSubSubresourceItemLegacy()
386391
387392 $ classMetadataProphecy = $ this ->prophesize (ClassMetadata::class);
388393 $ classMetadataProphecy ->getIdentifier ()->shouldBeCalled ()->willReturn ($ identifiers );
389- $ classMetadataProphecy ->getTypeOfField ('id ' )->shouldBeCalled ()->willReturn ('integer ' );
390394 $ classMetadataProphecy ->hasAssociation ('relatedDummies ' )->willReturn (true )->shouldBeCalled ();
391395 $ classMetadataProphecy ->getAssociationMapping ('relatedDummies ' )->shouldBeCalled ()->willReturn (['type ' => ClassMetadata::MANY_TO_MANY ]);
396+ $ classMetadataProphecy ->getTypeOfField ('id ' )->shouldBeCalled ()->willReturn (DBALType::INTEGER );
392397
393398 $ dummyManagerProphecy = $ this ->prophesize (EntityManager::class);
394399 $ dummyManagerProphecy ->createQueryBuilder ()->shouldBeCalled ()->willReturn ($ qb ->reveal ());
@@ -414,7 +419,7 @@ public function testGetSubSubresourceItemLegacy()
414419
415420 $ rClassMetadataProphecy = $ this ->prophesize (ClassMetadata::class);
416421 $ rClassMetadataProphecy ->getIdentifier ()->shouldBeCalled ()->willReturn ($ identifiers );
417- $ rClassMetadataProphecy ->getTypeOfField ('id ' )->shouldBeCalled ()->willReturn (' integer ' );
422+ $ rClassMetadataProphecy ->getTypeOfField ('id ' )->shouldBeCalled ()->willReturn (DBALType:: INTEGER );
418423 $ rClassMetadataProphecy ->hasAssociation ('thirdLevel ' )->shouldBeCalled ()->willReturn (true );
419424 $ rClassMetadataProphecy ->getAssociationMapping ('thirdLevel ' )->shouldBeCalled ()->willReturn (['type ' => ClassMetadata::MANY_TO_ONE ]);
420425
@@ -435,8 +440,8 @@ public function testGetSubSubresourceItemLegacy()
435440 $ queryBuilder ->andWhere ($ func )->shouldBeCalled ()->willReturn ($ queryBuilder );
436441
437442 $ queryBuilder ->getQuery ()->shouldBeCalled ()->willReturn ($ queryProphecy ->reveal ());
438- $ queryBuilder ->setParameter ('id_p1 ' , 1 )->shouldBeCalled ()->willReturn ($ queryBuilder );
439- $ queryBuilder ->setParameter ('id_p2 ' , 1 )->shouldBeCalled ()->willReturn ($ queryBuilder );
443+ $ queryBuilder ->setParameter ('id_p1 ' , 1 , DBALType:: INTEGER )->shouldBeCalled ()->willReturn ($ queryBuilder );
444+ $ queryBuilder ->setParameter ('id_p2 ' , 1 , DBALType:: INTEGER )->shouldBeCalled ()->willReturn ($ queryBuilder );
440445
441446 $ repositoryProphecy = $ this ->prophesize (EntityRepository::class);
442447 $ repositoryProphecy ->createQueryBuilder ('o ' )->shouldBeCalled ()->willReturn ($ queryBuilder ->reveal ());
@@ -483,6 +488,7 @@ public function testGetSubresourceCollectionItem()
483488 $ classMetadataProphecy = $ this ->prophesize (ClassMetadata::class);
484489 $ classMetadataProphecy ->hasAssociation ('relatedDummies ' )->willReturn (true )->shouldBeCalled ();
485490 $ classMetadataProphecy ->getAssociationMapping ('relatedDummies ' )->shouldBeCalled ()->willReturn (['type ' => ClassMetadata::MANY_TO_MANY ]);
491+ $ classMetadataProphecy ->getTypeOfField ('id ' )->shouldBeCalled ()->willReturn (DBALType::INTEGER );
486492
487493 $ dummyManagerProphecy = $ this ->prophesize (EntityManager::class);
488494 $ dummyManagerProphecy ->createQueryBuilder ()->shouldBeCalled ()->willReturn ($ qb ->reveal ());
@@ -509,6 +515,7 @@ public function testGetSubresourceCollectionItem()
509515 $ rClassMetadataProphecy = $ this ->prophesize (ClassMetadata::class);
510516 $ rClassMetadataProphecy ->hasAssociation ('id ' )->shouldBeCalled ()->willReturn (false );
511517 $ rClassMetadataProphecy ->isIdentifier ('id ' )->shouldBeCalled ()->willReturn (true );
518+ $ rClassMetadataProphecy ->getTypeOfField ('id ' )->shouldBeCalled ()->willReturn (DBALType::INTEGER );
512519
513520 $ rDummyManagerProphecy = $ this ->prophesize (EntityManager::class);
514521 $ rDummyManagerProphecy ->createQueryBuilder ()->shouldBeCalled ()->willReturn ($ rqb ->reveal ());
@@ -526,8 +533,8 @@ public function testGetSubresourceCollectionItem()
526533 $ queryBuilder ->andWhere ($ func )->shouldBeCalled ()->willReturn ($ queryBuilder );
527534
528535 $ queryBuilder ->getQuery ()->shouldBeCalled ()->willReturn ($ queryProphecy ->reveal ());
529- $ queryBuilder ->setParameter ('id_p1 ' , 2 )->shouldBeCalled ()->willReturn ($ queryBuilder );
530- $ queryBuilder ->setParameter ('id_p2 ' , 1 )->shouldBeCalled ()->willReturn ($ queryBuilder );
536+ $ queryBuilder ->setParameter ('id_p1 ' , 2 , DBALType:: INTEGER )->shouldBeCalled ()->willReturn ($ queryBuilder );
537+ $ queryBuilder ->setParameter ('id_p2 ' , 1 , DBALType:: INTEGER )->shouldBeCalled ()->willReturn ($ queryBuilder );
531538
532539 $ repositoryProphecy = $ this ->prophesize (EntityRepository::class);
533540 $ repositoryProphecy ->createQueryBuilder ('o ' )->shouldBeCalled ()->willReturn ($ queryBuilder ->reveal ());
0 commit comments