tests/PdoTest.php
/**
     * With multiple caches in play, calling flush() should only remove the
     * entries for the cache instance it is called on.
     */
With multiple caches in play, calling flush() should only remove the
entries for the cache instance it is called on.
With multiple caches in play calling flush () should only remove the entries for the cache instance it is called on .
public function testFlushCacheOnly_secondCache()
    {
        $options = array(
            'prefix_key'        => 'second-cache-key:', 
            'prefix_tag'        => 'second-cache-tag:', 
            'tag_enable'        => true               
        );
        $localCache = new $this->classname($this->pdo, $options);
        $this->assertTrue(
            $this->cache->save('data1_1', 'id1_1', array('tag1_1', 'tag1_2')) &&
            $this->cache->save('data1_2', 'id1_2', array('tag1_2', 'tag1_3')) &&
            $this->cache->save('data1_3', 'id1_3', array('tag1_3', 'tag1_4'))
            );
        $this->assertTrue(
            $localCache->save('data2_1', 'id2_1', array('tag2_1', 'tag2_2')) &&
            $localCache->save('data2_2', 'id2_2', array('tag2_2', 'tag2_3')) &&
            $localCache->save('data2_3', 'id2_3', array('tag2_3', 'tag2_4'))
            );
        $result = $this->cache->flush();
        $this->assertTrue($result);
        $this->assertNull($this->cache->load('id1_3'));
        $this->assertNull($this->cache->load('tag1_1', 'tag'));
        $this->assertNotNull($localCache->load('id2_3'));
        $this->assertNotNull($localCache->load('tag2_1', 'tag'));
        unset($localCache);
    }
public function testFlushCacheOnly_secondCache ( ) { $ options = array ( 'prefix_key' => 'second-cache-key:' , 'prefix_tag' => 'second-cache-tag:' , 'tag_enable' => true ) ; $ localCache = new $ this -> classname ( $ this -> pdo , $ options ) ; $ this -> assertTrue ( $ this -> cache -> save ( 'data1_1' , 'id1_1' , array ( 'tag1_1' , 'tag1_2' ) ) && $ this -> cache -> save ( 'data1_2' , 'id1_2' , array ( 'tag1_2' , 'tag1_3' ) ) && $ this -> cache -> save ( 'data1_3' , 'id1_3' , array ( 'tag1_3' , 'tag1_4' ) ) ) ; $ this -> assertTrue ( $ localCache -> save ( 'data2_1' , 'id2_1' , array ( 'tag2_1' , 'tag2_2' ) ) && $ localCache -> save ( 'data2_2' , 'id2_2' , array ( 'tag2_2' , 'tag2_3' ) ) && $ localCache -> save ( 'data2_3' , 'id2_3' , array ( 'tag2_3' , 'tag2_4' ) ) ) ; $ result = $ this -> cache -> flush ( ) ; $ this -> assertTrue ( $ result ) ; $ this -> assertNull ( $ this -> cache -> load ( 'id1_3' ) ) ; $ this -> assertNull ( $ this -> cache -> load ( 'tag1_1' , 'tag' ) ) ; $ this -> assertNotNull ( $ localCache -> load ( 'id2_3' ) ) ; $ this -> assertNotNull ( $ localCache -> load ( 'tag2_1' , 'tag' ) ) ; unset ( $ localCache ) ; }
With multiple caches in play, calling flush() should only remove the
 entries for the cache instance it is called on.
With multiple caches in play calling flush () should only remove the entries for the cache instance it is called on .
// prefix cache keys // prefix cache tags // wether to enable tagging /** @var AbstractPdo */