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); }
protected function getEntityMetadata($entity) { $factory = new MetadataFactory($this->getContainer()->get('doctrine')); return $factory->getClassMetadata($entity)->getMetadata(); }