public function testCache()
 {
     $this->annotationProvider->expects($this->exactly(2))->method('getAnnotations')->with($this->equalTo('action'))->will($this->returnValue(array()));
     $this->cache->expects($this->at(0))->method('fetch')->with(ActionMetadataProvider::CACHE_KEY);
     $this->cache->expects($this->at(1))->method('save')->with(ActionMetadataProvider::CACHE_KEY);
     $this->cache->expects($this->at(2))->method('delete')->with(ActionMetadataProvider::CACHE_KEY);
     $this->cache->expects($this->at(3))->method('fetch')->with(ActionMetadataProvider::CACHE_KEY);
     $this->provider->warmUpCache();
     $this->provider->clearCache();
     $this->assertFalse($this->provider->isKnownAction('unknown'));
 }
 /**
  * {@inheritdoc}
  */
 public function getClasses()
 {
     return $this->actionMetadataProvider->getActions();
 }
Exemplo n.º 3
0
 /**
  * @dataProvider supportsDataProvider
  *
  * @param mixed $id
  * @param string $type
  * @param string $action
  * @param bool $isKnownAction
  * @param bool $expected
  */
 public function testSupports($id, $type, $action, $isKnownAction, $expected)
 {
     $this->metadataProvider->expects($isKnownAction ? $this->once() : $this->never())->method('isKnownAction')->with($action)->willReturn($isKnownAction);
     $this->assertEquals($expected, $this->extension->supports($type, $id));
 }
 /**
  * {inheritdoc}
  */
 public function warmUp($cacheDir)
 {
     $this->provider->warmUpCache();
 }
 /**
  * {inheritdoc}
  */
 public function clear($cacheDir)
 {
     $this->provider->clearCache();
 }