/** * @covers HashBagOStuff::delete */ public function testDelete() { $cache = new HashBagOStuff(); for ($i = 0; $i < 10; $i++) { $cache->set("key{$i}", 1); $this->assertEquals(1, $cache->get("key{$i}")); $cache->delete("key{$i}"); $this->assertEquals(false, $cache->get("key{$i}")); } }
private function uncacheUser(User $user) { $this->stats->increment('WatchedItemStore.uncacheUser'); foreach ($this->cacheIndex as $ns => $dbKeyArray) { foreach ($dbKeyArray as $dbKey => $userArray) { if (isset($userArray[$user->getId()])) { $this->stats->increment('WatchedItemStore.uncacheUser.items'); $this->cache->delete($userArray[$user->getId()]); } } } }
/** * @param Title $title */ public function clearLink($title) { $dbkey = $title->getPrefixedDBkey(); $this->mBadLinks->delete($dbkey); $this->mGoodLinks->delete($dbkey); }
/** * @param LinkTarget $target */ public function clearLink(LinkTarget $target) { $dbkey = $this->titleFormatter->getPrefixedDBkey($target); $this->mBadLinks->delete($dbkey); $this->mGoodLinks->delete($dbkey); }