1111use DI \Container ;
1212use DI \ContainerBuilder ;
1313use Doctrine \ORM \EntityManager ;
14- use Doctrine \ORM \EntityManagerInterface ;
1514use Doctrine \ORM \Repository \RepositoryFactory ;
1615use Doctrine \ORM \Tools \Setup as DoctrineSetup ;
1716use PHPUnit \Framework \TestCase ;
@@ -42,7 +41,7 @@ public function testConstructor() : void
4241 */
4342 public function testGetRepository () : void
4443 {
45- $ entityManager = $ this ->container ->get (EntityManagerInterface ::class);
44+ $ entityManager = $ this ->container ->get (EntityManager ::class);
4645
4746 $ this ->container ->set ('foo ' , 'bar ' );
4847 $ this ->container ->set ('bar ' , 'baz ' );
@@ -58,7 +57,7 @@ public function testGetRepository() : void
5857 */
5958 public function testGetRepositoryRepeatedly () : void
6059 {
61- $ entityManager = $ this ->container ->get (EntityManagerInterface ::class);
60+ $ entityManager = $ this ->container ->get (EntityManager ::class);
6261
6362 $ this ->container ->set ('foo ' , 'bar ' );
6463 $ this ->container ->set ('bar ' , 'baz ' );
@@ -82,7 +81,7 @@ protected function setUp()
8281
8382 $ this ->container = $ builder ->build ();
8483
85- $ this ->container ->set (EntityManagerInterface ::class, function (Container $ container ) : EntityManagerInterface {
84+ $ this ->container ->set (EntityManager ::class, function (Container $ container ) : EntityManager {
8685 $ config = DoctrineSetup::createAnnotationMetadataConfiguration ([__DIR__ ], true , null , null , false );
8786 $ config ->setRepositoryFactory (new InjectableRepositoryFactory ($ container ));
8887
@@ -96,8 +95,8 @@ protected function setUp()
9695 */
9796 protected function tearDown ()
9897 {
99- if ($ this ->container ->has (EntityManagerInterface ::class)) {
100- $ entityManager = $ this ->container ->get (EntityManagerInterface ::class);
98+ if ($ this ->container ->has (EntityManager ::class)) {
99+ $ entityManager = $ this ->container ->get (EntityManager ::class);
101100 $ entityManager ->getConnection ()->close ();
102101 $ entityManager ->close ();
103102 }
0 commit comments