コード例 #1
0
 public function testCache()
 {
     $this->loader->expects($this->exactly(2))->method('load');
     $this->cache->expects($this->at(0))->method('fetch');
     $this->cache->expects($this->at(1))->method('save');
     $this->cache->expects($this->at(2))->method('delete');
     $this->cache->expects($this->at(3))->method('fetch');
     $this->provider->warmUpCache();
     $this->provider->clearCache();
     $this->assertNull($this->provider->findAnnotationById('unknown'));
 }
コード例 #2
0
 public function testCache()
 {
     // Called when: warmUpCache, findAnnotationById, warmUpCache
     $this->loader->expects($this->exactly(3))->method('load');
     // First warmUpCache
     $this->cache->expects($this->at(0))->method('save')->with(AclAnnotationProvider::CACHE_KEY);
     // clearCache
     $this->cache->expects($this->at(1))->method('delete')->with(AclAnnotationProvider::CACHE_KEY);
     // First findAnnotationById
     $this->cache->expects($this->at(2))->method('fetch')->with(AclAnnotationProvider::CACHE_KEY);
     $this->cache->expects($this->at(3))->method('save')->with(AclAnnotationProvider::CACHE_KEY);
     // Second warmUpCache
     $this->cache->expects($this->at(4))->method('save')->with(AclAnnotationProvider::CACHE_KEY);
     $this->provider->warmUpCache();
     $this->provider->clearCache();
     $this->assertNull($this->provider->findAnnotationById('unknown'));
     $this->provider->warmUpCache();
     $this->assertNull($this->provider->findAnnotationById('unknown'));
 }
コード例 #3
0
 /**
  * {inheritdoc}
  */
 public function warmUp($cacheDir)
 {
     $this->provider->warmUpCache();
 }