Fix small CS issues as per review
This commit is contained in:
parent
04acde667a
commit
aa233f8e57
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace Doctrine\Tests\ORM\Functional {
|
namespace Doctrine\Tests\ORM\Functional {
|
||||||
|
|
||||||
|
use Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest\Employee;
|
||||||
|
use Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest\Person;
|
||||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||||
|
|
||||||
class InstanceOfAbstractTest extends OrmFunctionalTestCase
|
class InstanceOfAbstractTest extends OrmFunctionalTestCase
|
||||||
@ -10,10 +12,10 @@ namespace Doctrine\Tests\ORM\Functional {
|
|||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->_schemaTool->createSchema(array(
|
$this->_schemaTool->createSchema([
|
||||||
$this->_em->getClassMetadata(__NAMESPACE__ . '\InstanceOfAbstractTest\Person'),
|
$this->_em->getClassMetadata(Person::class),
|
||||||
$this->_em->getClassMetadata(__NAMESPACE__ . '\InstanceOfAbstractTest\Employee'),
|
$this->_em->getClassMetadata(Employee::class),
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testInstanceOf()
|
public function testInstanceOf()
|
||||||
@ -55,7 +57,7 @@ namespace Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest {
|
|||||||
* @InheritanceType(value="JOINED")
|
* @InheritanceType(value="JOINED")
|
||||||
* @DiscriminatorColumn(name="kind", type="string")
|
* @DiscriminatorColumn(name="kind", type="string")
|
||||||
* @DiscriminatorMap(value={
|
* @DiscriminatorMap(value={
|
||||||
* "employee": "Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest\Employee"
|
* "employee": Employee::class
|
||||||
* })
|
* })
|
||||||
*/
|
*/
|
||||||
abstract class Person
|
abstract class Person
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
namespace Doctrine\Tests\ORM\Functional {
|
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;
|
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||||
|
|
||||||
class InstanceOfMultiLevelTest extends OrmFunctionalTestCase
|
class InstanceOfMultiLevelTest extends OrmFunctionalTestCase
|
||||||
@ -10,11 +13,11 @@ namespace Doctrine\Tests\ORM\Functional {
|
|||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->_schemaTool->createSchema(array(
|
$this->_schemaTool->createSchema([
|
||||||
$this->_em->getClassMetadata(__NAMESPACE__ . '\InstanceOfMultiLevelTest\Person'),
|
$this->_em->getClassMetadata(Person::class),
|
||||||
$this->_em->getClassMetadata(__NAMESPACE__ . '\InstanceOfMultiLevelTest\Employee'),
|
$this->_em->getClassMetadata(Employee::class),
|
||||||
$this->_em->getClassMetadata(__NAMESPACE__ . '\InstanceOfMultiLevelTest\Engineer'),
|
$this->_em->getClassMetadata(Engineer::class),
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testInstanceOf()
|
public function testInstanceOf()
|
||||||
@ -29,11 +32,11 @@ namespace Doctrine\Tests\ORM\Functional {
|
|||||||
$this->assertCount(3, $result);
|
$this->assertCount(3, $result);
|
||||||
|
|
||||||
foreach ($result as $r) {
|
foreach ($result as $r) {
|
||||||
$this->assertInstanceOf('Doctrine\Tests\ORM\Functional\InstanceOfMultiLevelTest\Person', $r);
|
$this->assertInstanceOf(Person::class, $r);
|
||||||
if ($r instanceof InstanceOfMultiLevelTest\Engineer) {
|
if ($r instanceof InstanceOfMultiLevelTest\Engineer) {
|
||||||
$this->assertEquals('foobar', $r->getName());
|
$this->assertEquals('foobar', $r->getName());
|
||||||
$this->assertEquals('doctrine', $r->getSpecialization());
|
$this->assertEquals('doctrine', $r->getSpecialization());
|
||||||
} elseif ($r instanceof InstanceOfMultiLevelTest\Employee) {
|
} elseif ($r instanceof Employee) {
|
||||||
$this->assertEquals('bar', $r->getName());
|
$this->assertEquals('bar', $r->getName());
|
||||||
$this->assertEquals('qux', $r->getDepartement());
|
$this->assertEquals('qux', $r->getDepartement());
|
||||||
} else {
|
} else {
|
||||||
@ -44,14 +47,14 @@ namespace Doctrine\Tests\ORM\Functional {
|
|||||||
|
|
||||||
private function loadData()
|
private function loadData()
|
||||||
{
|
{
|
||||||
$person = new InstanceOfMultiLevelTest\Person();
|
$person = new Person();
|
||||||
$person->setName('foo');
|
$person->setName('foo');
|
||||||
|
|
||||||
$employee = new InstanceOfMultiLevelTest\Employee();
|
$employee = new Employee();
|
||||||
$employee->setName('bar');
|
$employee->setName('bar');
|
||||||
$employee->setDepartement('qux');
|
$employee->setDepartement('qux');
|
||||||
|
|
||||||
$engineer = new InstanceOfMultiLevelTest\Engineer();
|
$engineer = new Engineer();
|
||||||
$engineer->setName('foobar');
|
$engineer->setName('foobar');
|
||||||
$engineer->setDepartement('dep');
|
$engineer->setDepartement('dep');
|
||||||
$engineer->setSpecialization('doctrine');
|
$engineer->setSpecialization('doctrine');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user