From aa233f8e57f8ae313eb7119174ce26377ec63cd5 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 3 May 2017 10:46:24 +0200 Subject: [PATCH] Fix small CS issues as per review --- .../ORM/Functional/InstanceOfAbstractTest.php | 12 ++++++---- .../Functional/InstanceOfMultiLevelTest.php | 23 +++++++++++-------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/InstanceOfAbstractTest.php b/tests/Doctrine/Tests/ORM/Functional/InstanceOfAbstractTest.php index 3a52d93f9..1b826a461 100644 --- a/tests/Doctrine/Tests/ORM/Functional/InstanceOfAbstractTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/InstanceOfAbstractTest.php @@ -2,6 +2,8 @@ namespace Doctrine\Tests\ORM\Functional { + use Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest\Employee; + use Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest\Person; use Doctrine\Tests\OrmFunctionalTestCase; class InstanceOfAbstractTest extends OrmFunctionalTestCase @@ -10,10 +12,10 @@ namespace Doctrine\Tests\ORM\Functional { { parent::setUp(); - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\InstanceOfAbstractTest\Person'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\InstanceOfAbstractTest\Employee'), - )); + $this->_schemaTool->createSchema([ + $this->_em->getClassMetadata(Person::class), + $this->_em->getClassMetadata(Employee::class), + ]); } public function testInstanceOf() @@ -55,7 +57,7 @@ namespace Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest { * @InheritanceType(value="JOINED") * @DiscriminatorColumn(name="kind", type="string") * @DiscriminatorMap(value={ - * "employee": "Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest\Employee" + * "employee": Employee::class * }) */ abstract class Person diff --git a/tests/Doctrine/Tests/ORM/Functional/InstanceOfMultiLevelTest.php b/tests/Doctrine/Tests/ORM/Functional/InstanceOfMultiLevelTest.php index c4b5bbcd2..131f053a2 100644 --- a/tests/Doctrine/Tests/ORM/Functional/InstanceOfMultiLevelTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/InstanceOfMultiLevelTest.php @@ -2,6 +2,9 @@ namespace Doctrine\Tests\ORM\Functional { + use Doctrine\Tests\ORM\Functional\InstanceOfMultiLevelTest\Employee; + use Doctrine\Tests\ORM\Functional\InstanceOfMultiLevelTest\Engineer; + use Doctrine\Tests\ORM\Functional\InstanceOfMultiLevelTest\Person; use Doctrine\Tests\OrmFunctionalTestCase; class InstanceOfMultiLevelTest extends OrmFunctionalTestCase @@ -10,11 +13,11 @@ namespace Doctrine\Tests\ORM\Functional { { parent::setUp(); - $this->_schemaTool->createSchema(array( - $this->_em->getClassMetadata(__NAMESPACE__ . '\InstanceOfMultiLevelTest\Person'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\InstanceOfMultiLevelTest\Employee'), - $this->_em->getClassMetadata(__NAMESPACE__ . '\InstanceOfMultiLevelTest\Engineer'), - )); + $this->_schemaTool->createSchema([ + $this->_em->getClassMetadata(Person::class), + $this->_em->getClassMetadata(Employee::class), + $this->_em->getClassMetadata(Engineer::class), + ]); } public function testInstanceOf() @@ -29,11 +32,11 @@ namespace Doctrine\Tests\ORM\Functional { $this->assertCount(3, $result); foreach ($result as $r) { - $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\InstanceOfMultiLevelTest\Person', $r); + $this->assertInstanceOf(Person::class, $r); if ($r instanceof InstanceOfMultiLevelTest\Engineer) { $this->assertEquals('foobar', $r->getName()); $this->assertEquals('doctrine', $r->getSpecialization()); - } elseif ($r instanceof InstanceOfMultiLevelTest\Employee) { + } elseif ($r instanceof Employee) { $this->assertEquals('bar', $r->getName()); $this->assertEquals('qux', $r->getDepartement()); } else { @@ -44,14 +47,14 @@ namespace Doctrine\Tests\ORM\Functional { private function loadData() { - $person = new InstanceOfMultiLevelTest\Person(); + $person = new Person(); $person->setName('foo'); - $employee = new InstanceOfMultiLevelTest\Employee(); + $employee = new Employee(); $employee->setName('bar'); $employee->setDepartement('qux'); - $engineer = new InstanceOfMultiLevelTest\Engineer(); + $engineer = new Engineer(); $engineer->setName('foobar'); $engineer->setDepartement('dep'); $engineer->setSpecialization('doctrine');