Skip to content

Commit 8b6388f

Browse files
ISSUE-168: Replaced string class names with static ::class references
1 parent 97a706a commit 8b6388f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/EntityTypeTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222

2323
use DarkWebDesign\SymfonyAddonFormTypes\EntityType;
2424
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;
2530
use Symfony\Component\Form\PreloadedExtension;
2631
use Symfony\Component\Form\Test\TypeTestCase;
2732

@@ -56,10 +61,10 @@ protected function setUp()
5661
$this->className = get_class($this->entity);
5762
$this->identifier = $this->entity->getId();
5863

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);
6368

6469
$this->entityManager->method('getRepository')->willReturn($this->repository);
6570
$this->entityManager->method('getClassMetadata')->willReturn($this->metadata);
@@ -142,7 +147,7 @@ public function testEntityManagerString()
142147

143148
$options = [
144149
'class' => $this->className,
145-
'entity_manager' => 'Doctrine\ORM\EntityManager',
150+
'entity_manager' => EntityManager::class,
146151
];
147152

148153
$form = $this->factory->create(EntityType::class, null, $options);

0 commit comments

Comments
 (0)