2011-03-04 01:11:09 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
|
|
|
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
require_once __DIR__ . '/../../../TestInit.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @group DDC-1041
|
|
|
|
*/
|
|
|
|
class DDC1041Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|
|
|
{
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
$this->useModelSet('company');
|
|
|
|
parent::setUp();
|
|
|
|
}
|
2011-12-20 01:56:19 +04:00
|
|
|
|
2011-03-04 01:11:09 +03:00
|
|
|
public function testGrabWrongSubtypeReturnsNull()
|
|
|
|
{
|
|
|
|
$fix = new \Doctrine\Tests\Models\Company\CompanyFixContract();
|
|
|
|
$fix->setFixPrice(2000);
|
2011-12-20 01:56:19 +04:00
|
|
|
|
2011-03-04 01:11:09 +03:00
|
|
|
$this->_em->persist($fix);
|
|
|
|
$this->_em->flush();
|
2011-12-20 01:56:19 +04:00
|
|
|
|
2011-03-04 01:11:09 +03:00
|
|
|
$id = $fix->getId();
|
2011-12-20 01:56:19 +04:00
|
|
|
|
2011-03-04 01:11:09 +03:00
|
|
|
$this->assertNull($this->_em->find('Doctrine\Tests\Models\Company\CompanyFlexContract', $id));
|
|
|
|
$this->assertNull($this->_em->getReference('Doctrine\Tests\Models\Company\CompanyFlexContract', $id));
|
|
|
|
$this->assertNull($this->_em->getPartialReference('Doctrine\Tests\Models\Company\CompanyFlexContract', $id));
|
|
|
|
}
|
|
|
|
}
|