Skip to content

Commit 498444f

Browse files
committed
Merge branch '5.1' into 5.2
* 5.1: Use ::class keyword when possible
2 parents 53b8304 + 6bba31a commit 498444f

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
@@ -81,7 +81,7 @@ public function testGetProperties()
8181

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

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

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

0 commit comments

Comments
 (0)