public function testShouldClearAllItems() { $this->checkDeps(); $storage = new WURFL_Storage_Memcache(array()); $storage->save("key1", "item1"); $storage->save("key2", "item2"); $storage->clear(); $this->assertThanNoElementsAreInStorage(array("key1", "key2"), $storage); }
private function checkDeps() { try { $cache = new WURFL_Storage_Memcache(); if (!$cache->isWURFLLoaded()) { $this->markTestSkipped("PHP extension 'memcache' must be loaded and a local memcache server running to run this test."); } } catch (\Exception $e) { $this->markTestSkipped("PHP extension 'memcache' must be loaded and a local memcache server running to run this test."); } if (!extension_loaded('memcache')) { $this->markTestSkipped("PHP extension 'memcache' must be loaded and a local memcache server running to run this test."); } }