1
0
mirror of synced 2025-02-03 05:49:25 +03:00

Move tests to ticket namespace (and rename them)

This commit is contained in:
Alessandro Lai 2017-05-03 11:06:43 +02:00
parent 11c84c7b20
commit 21e12ef4a9
No known key found for this signature in database
GPG Key ID: 5D9C513BE4F5798D
3 changed files with 16 additions and 14 deletions

View File

@ -1,12 +1,12 @@
<?php <?php
namespace Doctrine\Tests\ORM\Functional { namespace Doctrine\Tests\ORM\Functional\Ticket {
use Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest\Employee; use Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest\Employee;
use Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest\Person; use Doctrine\Tests\ORM\Functional\InstanceOfAbstractTest\Person;
use Doctrine\Tests\OrmFunctionalTestCase; use Doctrine\Tests\OrmFunctionalTestCase;
class InstanceOfAbstractTest extends OrmFunctionalTestCase class Ticket4646InstanceOfAbstractTest extends OrmFunctionalTestCase
{ {
protected function setUp() protected function setUp()
{ {
@ -30,15 +30,15 @@ namespace Doctrine\Tests\ORM\Functional {
$this->assertCount(1, $result); $this->assertCount(1, $result);
foreach ($result as $r) { foreach ($result as $r) {
$this->assertInstanceOf(InstanceOfAbstractTest\Person::class, $r); $this->assertInstanceOf(Person::class, $r);
$this->assertInstanceOf(InstanceOfAbstractTest\Employee::class, $r); $this->assertInstanceOf(Employee::class, $r);
$this->assertSame('bar', $r->getName()); $this->assertSame('bar', $r->getName());
} }
} }
private function loadData() private function loadData()
{ {
$employee = new InstanceOfAbstractTest\Employee(); $employee = new Employee();
$employee->setName('bar'); $employee->setName('bar');
$employee->setDepartement('qux'); $employee->setDepartement('qux');

View File

@ -1,13 +1,13 @@
<?php <?php
namespace Doctrine\Tests\ORM\Functional { namespace Doctrine\Tests\ORM\Functional\Ticket {
use Doctrine\Tests\ORM\Functional\InstanceOfMultiLevelTest\Employee; use Doctrine\Tests\ORM\Functional\InstanceOfMultiLevelTest\Employee;
use Doctrine\Tests\ORM\Functional\InstanceOfMultiLevelTest\Engineer; use Doctrine\Tests\ORM\Functional\InstanceOfMultiLevelTest\Engineer;
use Doctrine\Tests\ORM\Functional\InstanceOfMultiLevelTest\Person; use Doctrine\Tests\ORM\Functional\InstanceOfMultiLevelTest\Person;
use Doctrine\Tests\OrmFunctionalTestCase; use Doctrine\Tests\OrmFunctionalTestCase;
class InstanceOfMultiLevelTest extends OrmFunctionalTestCase class Ticket4646InstanceOfMultiLevelTest extends OrmFunctionalTestCase
{ {
protected function setUp() protected function setUp()
{ {
@ -33,7 +33,7 @@ namespace Doctrine\Tests\ORM\Functional {
foreach ($result as $r) { foreach ($result as $r) {
$this->assertInstanceOf(Person::class, $r); $this->assertInstanceOf(Person::class, $r);
if ($r instanceof InstanceOfMultiLevelTest\Engineer) { if ($r instanceof Engineer) {
$this->assertEquals('foobar', $r->getName()); $this->assertEquals('foobar', $r->getName());
$this->assertEquals('doctrine', $r->getSpecialization()); $this->assertEquals('doctrine', $r->getSpecialization());
} elseif ($r instanceof Employee) { } elseif ($r instanceof Employee) {

View File

@ -1,10 +1,12 @@
<?php <?php
namespace Doctrine\Tests\ORM\Functional { namespace Doctrine\Tests\ORM\Functional\Ticket {
use Doctrine\Tests\ORM\Functional\InstanceOfTest\Employee;
use Doctrine\Tests\ORM\Functional\InstanceOfTest\Person;
use Doctrine\Tests\OrmFunctionalTestCase; use Doctrine\Tests\OrmFunctionalTestCase;
class InstanceOfTest extends OrmFunctionalTestCase class Ticket4646InstanceOfTest extends OrmFunctionalTestCase
{ {
protected function setUp() protected function setUp()
{ {
@ -28,8 +30,8 @@ namespace Doctrine\Tests\ORM\Functional {
$this->assertCount(2, $result); $this->assertCount(2, $result);
foreach ($result as $r) { foreach ($result as $r) {
$this->assertInstanceOf(InstanceOfTest\Person::class, $r); $this->assertInstanceOf(Person::class, $r);
if ($r instanceof InstanceOfTest\Employee) { if ($r instanceof Employee) {
$this->assertEquals('bar', $r->getName()); $this->assertEquals('bar', $r->getName());
} else { } else {
$this->assertEquals('foo', $r->getName()); $this->assertEquals('foo', $r->getName());
@ -39,10 +41,10 @@ namespace Doctrine\Tests\ORM\Functional {
private function loadData() private function loadData()
{ {
$person = new InstanceOfTest\Person(); $person = new Person();
$person->setName('foo'); $person->setName('foo');
$employee = new InstanceOfTest\Employee(); $employee = new Employee();
$employee->setName('bar'); $employee->setName('bar');
$employee->setDepartement('qux'); $employee->setDepartement('qux');