3 namespace Doctrine\Tests\ORM\Functional\Ticket;
8 class DDC1526Test extends \Doctrine\Tests\OrmFunctionalTestCase
10 public function setUp()
13 $this->_schemaTool->createSchema(array(
14 $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1526Menu'),
18 public function testIssue()
21 for ($i = 0; $i < 9; $i++) {
22 $entity = new DDC1526Menu;
24 if (isset ($parents[($i % 3)])) {
25 $entity->parent = $parents[($i%3)];
28 $this->_em->persist($entity);
29 $parents[$i] = $entity;
36 FROM " . __NAMESPACE__ . "\DDC1526Menu m
37 LEFT JOIN m.children c";
38 $menus = $this->_em->createQuery($dql)->getResult();
40 // All Children collection now have to be initiailzed
41 foreach ($menus as $menu) {
42 $this->assertTrue($menu->children->isInitialized());
53 * @Column(type="integer")
59 * @ManyToOne(targetEntity="DDC1526Menu", inversedBy="children")
64 * @OneToMany(targetEntity="DDC1526Menu", mappedBy="parent")