public function getAssociation($fieldName) { if (!$this->hasAssociation($fieldName)) { throw MappingException::associationNotFound($this->name, $fieldName); } return $this->mappings[$fieldName]; }
/** * @depends testClassName * * @expectedException \Doctrine\ODM\PHPCR\Mapping\MappingException */ public function testGetAssociationNonexisting(ClassMetadata $cm) { $cm->getAssociation('nonexisting'); }