Skip to content

Commit 6bba31a

Browse files
committed
Use ::class keyword when possible
1 parent 8068ac5 commit 6bba31a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Tests/Form/Type/EntityTypeTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ protected function persist(array $entities)
118118

119119
public function testClassOptionIsRequired()
120120
{
121-
$this->expectException('Symfony\Component\OptionsResolver\Exception\MissingOptionsException');
121+
$this->expectException(\Symfony\Component\OptionsResolver\Exception\MissingOptionsException::class);
122122
$this->factory->createNamed('name', static::TESTED_TYPE);
123123
}
124124

125125
public function testInvalidClassOption()
126126
{
127-
$this->expectException('Symfony\Component\Form\Exception\RuntimeException');
127+
$this->expectException(\Symfony\Component\Form\Exception\RuntimeException::class);
128128
$this->factory->createNamed('name', static::TESTED_TYPE, null, [
129129
'class' => 'foo',
130130
]);
@@ -219,7 +219,7 @@ public function testSetDataToUninitializedEntityWithNonRequiredQueryBuilder()
219219

220220
public function testConfigureQueryBuilderWithNonQueryBuilderAndNonClosure()
221221
{
222-
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
222+
$this->expectException(\Symfony\Component\OptionsResolver\Exception\InvalidOptionsException::class);
223223
$this->factory->createNamed('name', static::TESTED_TYPE, null, [
224224
'em' => 'default',
225225
'class' => self::SINGLE_IDENT_CLASS,
@@ -229,7 +229,7 @@ public function testConfigureQueryBuilderWithNonQueryBuilderAndNonClosure()
229229

230230
public function testConfigureQueryBuilderWithClosureReturningNonQueryBuilder()
231231
{
232-
$this->expectException('Symfony\Component\Form\Exception\UnexpectedTypeException');
232+
$this->expectException(\Symfony\Component\Form\Exception\UnexpectedTypeException::class);
233233
$field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [
234234
'em' => 'default',
235235
'class' => self::SINGLE_IDENT_CLASS,
@@ -1242,7 +1242,7 @@ public function testLoaderCaching()
12421242
$choiceList2 = $form->get('property2')->getConfig()->getAttribute('choice_list');
12431243
$choiceList3 = $form->get('property3')->getConfig()->getAttribute('choice_list');
12441244

1245-
$this->assertInstanceOf('Symfony\Component\Form\ChoiceList\LazyChoiceList', $choiceList1);
1245+
$this->assertInstanceOf(\Symfony\Component\Form\ChoiceList\LazyChoiceList::class, $choiceList1);
12461246
$this->assertSame($choiceList1, $choiceList2);
12471247
$this->assertSame($choiceList1, $choiceList3);
12481248
}
@@ -1302,7 +1302,7 @@ public function testLoaderCachingWithParameters()
13021302
$choiceList2 = $form->get('property2')->getConfig()->getAttribute('choice_list');
13031303
$choiceList3 = $form->get('property3')->getConfig()->getAttribute('choice_list');
13041304

1305-
$this->assertInstanceOf('Symfony\Component\Form\ChoiceList\LazyChoiceList', $choiceList1);
1305+
$this->assertInstanceOf(\Symfony\Component\Form\ChoiceList\LazyChoiceList::class, $choiceList1);
13061306
$this->assertSame($choiceList1, $choiceList2);
13071307
$this->assertSame($choiceList1, $choiceList3);
13081308
}

Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function testGetProperties()
8585

8686
public function testTestGetPropertiesWithEmbedded()
8787
{
88-
if (!class_exists('Doctrine\ORM\Mapping\Embedded')) {
88+
if (!class_exists(\Doctrine\ORM\Mapping\Embedded::class)) {
8989
$this->markTestSkipped('@Embedded is not available in Doctrine ORM lower than 2.5.');
9090
}
9191

@@ -108,7 +108,7 @@ public function testExtract($property, array $type = null)
108108

109109
public function testExtractWithEmbedded()
110110
{
111-
if (!class_exists('Doctrine\ORM\Mapping\Embedded')) {
111+
if (!class_exists(\Doctrine\ORM\Mapping\Embedded::class)) {
112112
$this->markTestSkipped('@Embedded is not available in Doctrine ORM lower than 2.5.');
113113
}
114114

0 commit comments

Comments
 (0)