public function test_entityNamespace() { $config = new Configuration(); $config->setEntityNamespaces(['PasinterOHM' => 'Pasinter\\OHM\\Entity']); $this->assertEquals('Pasinter\\OHM\\Entity', $config->getEntityNamespace('PasinterOHM')); $config->addEntityNamespace('PasinterOHM2', 'Pasinter\\OHM2\\Entity'); $this->assertEquals('Pasinter\\OHM2\\Entity', $config->getEntityNamespace('PasinterOHM2')); }
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')); }