/** * {@inheritdoc} */ public function supports($type, $id) { if ($type === ObjectIdentityFactory::ROOT_IDENTITY_TYPE && $id === $this->getExtensionKey()) { return true; } return $id === $this->getExtensionKey() && $this->actionMetadataProvider->isKnownAction($type); }
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 supports($type, $id) { if ($type === ObjectIdentityFactory::ROOT_IDENTITY_TYPE && $id === $this->getExtensionKey()) { return true; } $delim = strpos($type, '@'); if ($delim !== false) { $type = ltrim(substr($type, $delim + 1), ' '); } return $id === $this->getExtensionKey() && $this->actionMetadataProvider->isKnownAction($type); }