1111
1212namespace Symfony \Bridge \Doctrine \Tests \IdGenerator ;
1313
14+ use Doctrine \ORM \EntityManager ;
1415use PHPUnit \Framework \TestCase ;
1516use Symfony \Bridge \Doctrine \IdGenerator \UuidGenerator ;
1617use Symfony \Component \Uid \Factory \UuidFactory ;
@@ -25,7 +26,7 @@ class UuidGeneratorTest extends TestCase
2526{
2627 public function testUuidCanBeGenerated ()
2728 {
28- $ em = new EntityManager ();
29+ $ em = ( new \ ReflectionClass ( EntityManager::class))-> newInstanceWithoutConstructor ();
2930 $ generator = new UuidGenerator ();
3031 $ uuid = $ generator ->generate ($ em , new Entity ());
3132
@@ -35,7 +36,7 @@ public function testUuidCanBeGenerated()
3536 public function testCustomUuidfactory ()
3637 {
3738 $ uuid = new UuidV4 ();
38- $ em = new EntityManager ();
39+ $ em = ( new \ ReflectionClass ( EntityManager::class))-> newInstanceWithoutConstructor ();
3940 $ factory = $ this ->createMock (UuidFactory::class);
4041 $ factory ->expects ($ this ->any ())
4142 ->method ('create ' )
@@ -47,7 +48,7 @@ public function testCustomUuidfactory()
4748
4849 public function testUuidfactory ()
4950 {
50- $ em = new EntityManager ();
51+ $ em = ( new \ ReflectionClass ( EntityManager::class))-> newInstanceWithoutConstructor ();
5152 $ generator = new UuidGenerator ();
5253 $ this ->assertInstanceOf (UuidV6::class, $ generator ->generate ($ em , new Entity ()));
5354
0 commit comments