Skip to content

Commit 608b0af

Browse files
committed
Use ::class keyword when possible
1 parent 498444f commit 608b0af

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function testFilterUid($entityClass)
160160

161161
$em = DoctrineTestHelper::createTestEntityManager();
162162

163-
$query = $this->getMockBuilder('QueryMock')
163+
$query = $this->getMockBuilder(\QueryMock::class)
164164
->setMethods(['setParameter', 'getResult', 'getSql', '_doExecute'])
165165
->getMock();
166166

@@ -173,7 +173,7 @@ public function testFilterUid($entityClass)
173173
->with('ORMQueryBuilderLoader_getEntitiesByIds_id', [Uuid::fromString('71c5fd46-3f16-4abb-bad7-90ac1e654a2d')->toBinary(), Uuid::fromString('b98e8e11-2897-44df-ad24-d2627eb7f499')->toBinary()], Connection::PARAM_STR_ARRAY)
174174
->willReturn($query);
175175

176-
$qb = $this->getMockBuilder('Doctrine\ORM\QueryBuilder')
176+
$qb = $this->getMockBuilder(\Doctrine\ORM\QueryBuilder::class)
177177
->setConstructorArgs([$em])
178178
->setMethods(['getQuery'])
179179
->getMock();
@@ -205,7 +205,7 @@ public function testUidThrowProperException($entityClass)
205205

206206
$em = DoctrineTestHelper::createTestEntityManager();
207207

208-
$qb = $this->getMockBuilder('Doctrine\ORM\QueryBuilder')
208+
$qb = $this->getMockBuilder(\Doctrine\ORM\QueryBuilder::class)
209209
->setConstructorArgs([$em])
210210
->setMethods(['getQuery'])
211211
->getMock();

Tests/Form/DoctrineOrmTypeGuesserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DoctrineOrmTypeGuesserTest extends TestCase
2828
*/
2929
public function testTypeGuesser(string $type, $expected)
3030
{
31-
$classMetadata = $this->getMockBuilder('Doctrine\ORM\Mapping\ClassMetadata')->disableOriginalConstructor()->getMock();
31+
$classMetadata = $this->getMockBuilder(ClassMetadata::class)->disableOriginalConstructor()->getMock();
3232
$classMetadata->fieldMappings['field'] = true;
3333
$classMetadata->expects($this->once())->method('getTypeOfField')->with('field')->willReturn($type);
3434

Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public function testAllConfiguredFieldsAreCheckedOfBeingMappedByDoctrineWithIgno
300300
{
301301
$entity1 = new SingleIntIdEntity(1, null);
302302

303-
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
303+
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
304304
$this->validator->validate($entity1, $constraint);
305305
}
306306

@@ -616,7 +616,7 @@ public function testValidateUniquenessWithArrayValue()
616616

617617
public function testDedicatedEntityManagerNullObject()
618618
{
619-
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
619+
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
620620
$this->expectExceptionMessage('Object manager "foo" does not exist.');
621621
$constraint = new UniqueEntity([
622622
'message' => 'myMessage',
@@ -636,7 +636,7 @@ public function testDedicatedEntityManagerNullObject()
636636

637637
public function testEntityManagerNullObject()
638638
{
639-
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
639+
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
640640
$this->expectExceptionMessage('Unable to find the object manager associated with an entity of class "Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity"');
641641
$constraint = new UniqueEntity([
642642
'message' => 'myMessage',
@@ -718,7 +718,7 @@ public function testValidateInheritanceUniqueness()
718718

719719
public function testInvalidateRepositoryForInheritance()
720720
{
721-
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
721+
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
722722
$this->expectExceptionMessage('The "Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity" entity repository does not support the "Symfony\Bridge\Doctrine\Tests\Fixtures\Person" entity. The entity should be an instance of or extend "Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity".');
723723
$constraint = new UniqueEntity([
724724
'message' => 'myMessage',

0 commit comments

Comments
 (0)