Exemplo n.º 1
0
 public function testCachedMetadataFromFactory()
 {
     $cache = new \Doctrine\Common\Cache\ArrayCache();
     $this->factory = new ClassMetadataFactory($this->loader, $cache);
     $metadata = $this->factory->getClassMetadata('Tests\\Dummy\\Classes\\AnnotatedClass');
     $this->assertTrue($cache->contains(ltrim('Tests\\Dummy\\Classes\\AnnotatedClass', '\\')));
     //Get new Factory to retrieve from cache
     $this->factory = new ClassMetadataFactory($this->loader, $cache);
     $metadataCached = $this->factory->getClassMetadata('Tests\\Dummy\\Classes\\AnnotatedClass');
     $this->assertEquals($metadata, $metadataCached);
 }