File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
tests/Doctrine/Tests/ORM/Functional/Ticket Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,15 @@ private function classTests($className): void
4848 $ this ->_em ->persist ($ child ->rel );
4949 $ this ->_em ->flush ();
5050 $ this ->_em ->clear ();
51+ $ id = $ child ->id ;
5152
5253 // Test find by rel
5354 $ child = $ this ->_em ->getRepository ($ className )->findOneBy (['rel ' => $ child ->rel ]);
5455 self ::assertNotNull ($ child );
5556 $ this ->_em ->clear ();
5657
5758 // Test query by id with fetch join
58- $ child = $ this ->_em ->createQuery ('SELECT t, r FROM ' . $ className . ' t JOIN t.rel r WHERE t.id = 1 ' )->getOneOrNullResult ();
59+ $ child = $ this ->_em ->createQuery ('SELECT t, r FROM ' . $ className . ' t JOIN t.rel r WHERE t.id = ?0 ' )-> setParameter ( 0 , $ id )->getOneOrNullResult ();
5960 self ::assertNotNull ($ child );
6061
6162 // Test lock and update
@@ -65,14 +66,15 @@ private function classTests($className): void
6566 $ child ->status = 0 ;
6667 });
6768 $ this ->_em ->clear ();
68- $ child = $ this ->_em ->getRepository ($ className )->find (1 );
69+ $ child = $ this ->_em ->getRepository ($ className )->find ($ id );
70+ self ::assertNotNull ($ child );
6971 self ::assertEquals ($ child ->firstName , 'Bob ' );
7072 self ::assertEquals ($ child ->status , 0 );
7173
7274 // Test delete
7375 $ this ->_em ->remove ($ child );
7476 $ this ->_em ->flush ();
75- $ child = $ this ->_em ->getRepository ($ className )->find (1 );
77+ $ child = $ this ->_em ->getRepository ($ className )->find ($ id );
7678 self ::assertNull ($ child );
7779 }
7880}
You can’t perform that action at this time.
0 commit comments