コード例 #1
0
 public function testFindNamespaceAndPathForMetadata()
 {
     $class = new ClassMetadataInfo(__CLASS__);
     $collection = new ClassMetadataCollection(array($class));
     $registry = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry');
     $factory = new MetadataFactory($registry);
     $this->setExpectedException("RuntimeException", "Can't find base path for \"Doctrine\\Bundle\\DoctrineBundle\\Tests\\MetadataFactoryTest");
     $factory->findNamespaceAndPathForMetadata($collection);
 }
コード例 #2
0
 protected function getEntityMetadata($entity)
 {
     $factory = new MetadataFactory($this->getContainer()->get('doctrine'));
     return $factory->getClassMetadata($entity)->getMetadata();
 }