public function test_getMetadataFor()
 {
     $cmFactory = new ClassMetadataFactory();
     $emConfig = new Configuration();
     $emConfig->setEntityNamespaces(['PasinterMocks' => 'Pasinter\\Mocks\\Entity']);
     $emConfig->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader(), __DIR__ . '/../../Mocks/Entity/'));
     $emConfig->setMetadataCacheImpl(new ArrayCache());
     $cmFactory->setEntityManager(new EntityManager($this->getMock('Pasinter\\OHM\\Storage\\StorageInterface'), $emConfig));
     $cmFactory->getAllMetadata();
     $this->assertInstanceOf('Pasinter\\OHM\\Mapping\\ClassMetadata', $cmFactory->getMetadataFor('PasinterMocks:Blog\\Post'));
 }
Exemplo n.º 2
0
 /**
  * 
  * @param string $className
  * @return ClassMetadata
  */
 public function getClassMetadata($className)
 {
     return $this->metadataFactory->getMetadataFor(ltrim($className, '\\'));
 }