public function testRemoveReferrerMany()
{
$refManyTestObj = new RefManyTestObj();
$refManyTestObj->id = "/functional/refManyTestObj";
$max = 5;
for ($i = 0; $i < $max; $i++) {
$newRefRefTestObj = new RefRefTestObj();
$newRefRefTestObj->id = "/functional/refRefTestObj{$i}";
$newRefRefTestObj->name = "refRefTestObj{$i}";
$refManyTestObj->references[] = $newRefRefTestObj;
}
$this->dm->persist($refManyTestObj);
$this->dm->flush();
$this->dm->clear();
$referrer = $this->dm->find($this->referrerManyType, '/functional/refManyTestObj');
$this->dm->remove($referrer);
$this->dm->flush();
$this->dm->clear();
$testReferrer = $this->dm->find($this->referrerType, '/functional/refTestObj');
$this->assertNull($testReferrer);
$this->assertFalse($this->session->getNode('/functional')->hasNode('refTestObj'));
$max = 5;
for ($i = 0; $i < $max; $i++) {
$this->assertTrue($this->session->getNode('/functional')->hasNode("refRefTestObj{$i}"));
$this->assertEquals("refRefTestObj{$i}", $this->session->getNode('/functional')->getPropertyValue("refRefTestObj{$i}/name"));
}
}