1
0
mirror of synced 2025-01-18 06:21:40 +03:00

DDC-1461 - Fix test failures

This commit is contained in:
Benjamin Eberlei 2011-11-14 21:05:44 +01:00
parent 4c7e4296c9
commit 909504c074
2 changed files with 2 additions and 28 deletions

View File

@ -38,7 +38,7 @@ class CmsAddress
public $street;
/**
* @OneToOne(targetEntity="CmsUser", inversedBy="address", cascade={"persist"})
* @OneToOne(targetEntity="CmsUser", inversedBy="address")
* @JoinColumn(referencedColumnName="id")
*/
public $user;

View File

@ -14,7 +14,6 @@ class DDC1461Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
public function setUp()
{
$this->useModelSet('cms');
parent::setUp();
try {
@ -26,32 +25,7 @@ class DDC1461Test extends \Doctrine\Tests\OrmFunctionalTestCase
}
}
public function testChangeDetectionDeferredImplitic()
{
$address = new \Doctrine\Tests\Models\CMS\CmsAddress();
$address->city = "Karlsruhe";
$address->country = "Germany";
$address->street = "somestreet";
$address->zip = 12345;
$this->_em->persist($address);
$this->_em->flush();
$user = new CmsUser();
$user->name = "schmittjoh";
$user->username = "schmittjoh";
$user->status = "active";
$address->setUser($user);
$this->_em->flush();
$this->_em->clear();
$user = $this->_em->find(get_class($user), $user->getId());
$this->assertNotNull($user->getAddress());
$this->assertEquals("Karlsruhe", $user->getAddress()->getCity());
}
public function testChangeDetectionDeferredExplicit()
{
$user = new DDC1461User;