-
-
Save doctrinebot/663fcfa957f0b78e0750 to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-1607 - https://github.com/doctrine/doctrine2/issues/2246
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Doctrine\Tests\ORM\Functional\Ticket; | |
/** | |
* @group DDC-1607 | |
*/ | |
class DDC1607Test extends \Doctrine\Tests\OrmFunctionalTestCase | |
{ | |
public function setUp() | |
{ | |
parent::setUp(); | |
$this->_schemaTool->createSchema(array( | |
$this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1607A'), | |
$this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1607B'), | |
)); | |
} | |
public function testIssue() | |
{ | |
$a = new DDC1607A(); | |
$this->_em->persist($a); | |
$this->_em->flush(); | |
$this->_em->clear(); | |
$persistedA = $this->_em->find(__NAMESPACE__ . '\\DDC1607A', $a->id); | |
$this->assertNotNull($persistedA); | |
} | |
} | |
/** | |
* @Entity | |
*/ | |
class DDC1607A | |
{ | |
/** | |
* @Id @GeneratedValue | |
* @Column(type="integer") | |
*/ | |
public $id; | |
/** | |
* @OneToOne(targetEntity="DDC1607B", fetch="EAGER") | |
* @JoinColumn(nullable=true) | |
*/ | |
public $b; | |
} | |
/** | |
* @Entity | |
*/ | |
class DDC1607B | |
{ | |
/** | |
* @Id @GeneratedValue | |
* @Column(type="integer") | |
*/ | |
public $id; | |
/** | |
* @Column(type="string") | |
*/ | |
public $name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment