1
0
mirror of synced 2024-12-05 03:06:05 +03:00

unittest DDC3597: fix for PHP 5.4

This commit is contained in:
Volker von Hoesslin 2015-03-04 11:55:08 +01:00
parent 2aef87c9b2
commit 0824c6136d
4 changed files with 16 additions and 13 deletions

View File

@ -12,6 +12,8 @@ use Doctrine\Tests\Models\DDC3597\Embeddable\DDC3597Dimension;
*/
class DDC3597Image extends DDC3597Media {
const CLASSNAME = __CLASS__;
/**
* @var DDC3597Dimension
* @Embedded(class = "Doctrine\Tests\Models\DDC3597\Embeddable\DDC3597Dimension", columnPrefix = false)

View File

@ -10,6 +10,8 @@ namespace Doctrine\Tests\Models\DDC3597;
*/
abstract class DDC3597Media extends DDC3597Root {
const CLASSNAME = __CLASS__;
/**
* @var string
*

View File

@ -15,6 +15,8 @@ use Doctrine\ORM\Mapping\DiscriminatorMap;
*/
abstract class DDC3597Root {
const CLASSNAME = __CLASS__;
/**
* @var int
*

View File

@ -2,23 +2,21 @@
namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\Tests\Models\DDC3597\DDC3597Root;
use Doctrine\Tests\Models\DDC3597\DDC3597Media;
use Doctrine\Tests\Models\DDC3597\DDC3597Image;
use Doctrine\Tests\Models\DDC3597\DDC3597Media;
use Doctrine\Tests\Models\DDC3597\DDC3597Root;
/**
* @group DDC-117
*/
class DDC3597Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
class DDC3597Test extends \Doctrine\Tests\OrmFunctionalTestCase {
protected function setUp()
{
protected function setUp() {
parent::setUp();
$this->_schemaTool->createSchema(array(
$this->_em->getClassMetadata(DDC3597Root::class),
$this->_em->getClassMetadata(DDC3597Media::class),
$this->_em->getClassMetadata(DDC3597Image::class)
$this->_em->getClassMetadata(DDC3597Root::CLASSNAME),
$this->_em->getClassMetadata(DDC3597Media::CLASSNAME),
$this->_em->getClassMetadata(DDC3597Image::CLASSNAME)
));
}
@ -38,8 +36,8 @@ class DDC3597Test extends \Doctrine\Tests\OrmFunctionalTestCase
$this->_em->clear();
//request entity
$imageEntity = $this->_em->find(DDC3597Image::class, $imageEntity->getId());
$this->assertInstanceOf(DDC3597Image::class, $imageEntity);
$imageEntity = $this->_em->find(DDC3597Image::CLASSNAME, $imageEntity->getId());
$this->assertInstanceOf(DDC3597Image::CLASSNAME, $imageEntity);
//cleanup
$this->_em->remove($imageEntity);
@ -47,8 +45,7 @@ class DDC3597Test extends \Doctrine\Tests\OrmFunctionalTestCase
$this->_em->clear();
//check delete
$imageEntity = $this->_em->find(DDC3597Image::class, $imageEntity->getId());
$imageEntity = $this->_em->find(DDC3597Image::CLASSNAME, $imageEntity->getId());
$this->assertNull($imageEntity);
}
}