|
22 | 22 |
|
23 | 23 | use DarkWebDesign\SymfonyAddonFormTypes\EntityType; |
24 | 24 | use DarkWebDesign\SymfonyAddonFormTypes\Tests\Models\City; |
| 25 | +use Doctrine\Common\Persistence\ManagerRegistry; |
| 26 | +use Doctrine\Common\Persistence\Mapping\ClassMetadata; |
| 27 | +use Doctrine\Common\Persistence\ObjectManager; |
| 28 | +use Doctrine\Common\Persistence\ObjectRepository; |
| 29 | +use Doctrine\ORM\EntityManager; |
25 | 30 | use Symfony\Component\Form\PreloadedExtension; |
26 | 31 | use Symfony\Component\Form\Test\TypeTestCase; |
27 | 32 |
|
@@ -56,10 +61,10 @@ protected function setUp() |
56 | 61 | $this->className = get_class($this->entity); |
57 | 62 | $this->identifier = $this->entity->getId(); |
58 | 63 |
|
59 | | - $this->registry = $this->createMock('Doctrine\Common\Persistence\ManagerRegistry'); |
60 | | - $this->entityManager = $this->createMock('Doctrine\Common\Persistence\ObjectManager'); |
61 | | - $this->repository = $this->createMock('Doctrine\Common\Persistence\ObjectRepository'); |
62 | | - $this->metadata = $this->createMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); |
| 64 | + $this->registry = $this->createMock(ManagerRegistry::class); |
| 65 | + $this->entityManager = $this->createMock(ObjectManager::class); |
| 66 | + $this->repository = $this->createMock(ObjectRepository::class); |
| 67 | + $this->metadata = $this->createMock(ClassMetadata::class); |
63 | 68 |
|
64 | 69 | $this->entityManager->method('getRepository')->willReturn($this->repository); |
65 | 70 | $this->entityManager->method('getClassMetadata')->willReturn($this->metadata); |
@@ -142,7 +147,7 @@ public function testEntityManagerString() |
142 | 147 |
|
143 | 148 | $options = [ |
144 | 149 | 'class' => $this->className, |
145 | | - 'entity_manager' => 'Doctrine\ORM\EntityManager', |
| 150 | + 'entity_manager' => EntityManager::class, |
146 | 151 | ]; |
147 | 152 |
|
148 | 153 | $form = $this->factory->create(EntityType::class, null, $options); |
|
0 commit comments