Ejemplo n.º 1
0
 public function testCleanByTagsWithIntersectOnlyAndWildcardComparisonAndOneTag()
 {
     $item = new CacheableData('key2', null, 'toto');
     $this->adapter->set($item);
     $item2 = new CacheableData('key3', null, 'toto2');
     $this->adapter->set($item2);
     $this->assertEquals('toto', $this->adapter->get($item));
     $this->manager->addKeyToTag('version', 150, 'key2');
     $this->manager->addKeyToTag('country', 'FR', 'key2');
     $this->manager->addKeyToTag('version', 1500, 'key3');
     $this->manager->addKeyToTag('country', 'FR', 'key3');
     $this->manager->cleanByTags(array('version' => array('value' => 10, 'type' => 'wildcard')), true);
     $this->assertEquals('toto', $this->adapter->get($item));
     $this->assertEquals('toto2', $this->adapter->get($item2));
     $this->manager->cleanByTags(array('version' => array('value' => 150, 'type' => 'wildcard')), true);
     $this->assertFalse($this->adapter->get($item));
     $this->assertFalse($this->adapter->get($item2));
 }
Ejemplo n.º 2
0
 /**
  * @param string $tag
  * @param string $value
  * @param string $key
  */
 public function createTag($tag, $value, $key)
 {
     $this->tagManager->addKeyToTag($tag, $key, $value);
 }