Esempio n. 1
0
 /**
  * @test
  */
 public function get_metadata_for_should_store_data_into_cache()
 {
     $className = get_class($this);
     $this->cache->fetch(Argument::type('string'))->willReturn(null);
     $this->cache->save($className, Argument::type('Kcs\\Metadata\\ClassMetadataInterface'))->shouldBeCalled()->willReturn(true);
     $this->cache->save(Argument::type('string'), Argument::type('Kcs\\Metadata\\MetadataInterface'))->willReturn(true);
     $this->loader->loadClassMetadata(Argument::type('Kcs\\Metadata\\ClassMetadataInterface'))->willReturn(true);
     $factory = new MetadataFactory($this->loader->reveal(), null, $this->cache->reveal());
     $factory->getMetadataFor($this);
 }
Esempio n. 2
0
 protected function setUp()
 {
     parent::setUp();
     $this->cache = $this->prophesize('Doctrine\\Common\\Cache\\Cache');
     $this->mem = new Memoize($this->cache->reveal(), $this->defaultLifeTime);
 }