コード例 #1
0
 public function testAddKeyToTags()
 {
     $tags = array('version' => 123, 'language' => 'fr');
     $this->manager->addKeyToTags($tags, 'key');
     $item = new CacheableData('TAG__VERSION_', null, null);
     $content = unserialize($this->adapter->get($item));
     $this->assertEquals(array('TAG__VERSION_123' => 'TAG__VERSION_123'), $content);
     $item = new CacheableData('TAG__VERSION_123', null, null);
     $content = unserialize($this->adapter->get($item));
     $this->assertEquals(array('key' => 'key'), $content);
     $item = new CacheableData('TAG__LANGUAGE_', null, null);
     $content = unserialize($this->adapter->get($item));
     $this->assertEquals(array('TAG__LANGUAGE_FR' => 'TAG__LANGUAGE_FR'), $content);
     $item = new CacheableData('TAG__LANGUAGE_FR', null, null);
     $content = unserialize($this->adapter->get($item));
     $this->assertEquals(array('key' => 'key'), $content);
 }
コード例 #2
0
ファイル: TagHandler.php プロジェクト: itkg/api-extra-bundle
 /**
  * @param array  $tags
  * @param string $key
  */
 public function createTags(array $tags, $key)
 {
     $this->tagManager->addKeyToTags($tags, $key);
 }