cleanP() abstract public method

Cleans cache: all entries with a certain $base and $id
abstract public cleanP ( $base, $id ) : boolean
return boolean true if no problem
Example #1
0
 private function setBigClean(CacheAbstract $cache)
 {
     $id = '2';
     $base = 'bigclean';
     $otherid = '3';
     $retval = $cache->storeP(111, $base, $id, 'a');
     $this->assertEquals(true, $retval);
     $retval = $cache->storeP(222, $base, $id, 'b');
     $this->assertEquals(true, $retval);
     $retval = $cache->storeP(333, $base, $otherid, 'a');
     $this->assertEquals(true, $retval);
     $data = $cache->getP($base, $id, 'a');
     $this->assertEquals(111, $data);
     $data = $cache->getP($base, $id, 'b');
     $this->assertEquals(222, $data);
     $data = $cache->getP($base, $otherid, 'a');
     $this->assertEquals(333, $data);
     $cache->cleanP($base, $id);
     try {
         $data = $cache->getP($base, $id, 'a');
         $this->fail();
     } catch (Cachearium\Exceptions\NotCachedException $e) {
         $this->assertTrue(true);
     }
     try {
         $data = $cache->getP($base, $otherid, 'a');
         $this->assertEquals(333, $data);
     } catch (Cachearium\Exceptions\NotCachedException $e) {
         $this->fail();
     }
     try {
         $data = $cache->getP($base, $id, 'b');
         $this->fail();
     } catch (Cachearium\Exceptions\NotCachedException $e) {
         $this->assertTrue(true);
     }
 }