public function testHardReferenceDelete()
{
$hardRefTestObj = new HardRefTestObj();
$refRefTestObj = new RefRefTestObj();
$hardRefTestObj->id = "/functional/hardRefTestObj";
$refRefTestObj->id = "/functional/refRefTestObj";
$refRefTestObj->name = "referenced";
$hardRefTestObj->reference = $refRefTestObj;
$this->dm->persist($hardRefTestObj);
$this->dm->flush();
$this->dm->clear();
$referenced = $this->dm->find($this->referencedType, '/functional/refRefTestObj');
$this->setExpectedException('PHPCR\\ReferentialIntegrityException');
$this->dm->remove($referenced);
$this->dm->flush();
$this->dm->clear();
}