public function testDelete() { $this->storage->get('oldkey'); $this->assertArrayHasKey('oldkey', $this->storage->getCasArray(), 'Cas array has not key "oldkey"!'); $this->assertEquals(0, $this->storage->delete('oldkey'), 'Delete failed!'); $this->assertArrayNotHasKey('oldkey', $this->storage->getCasArray(), 'Cas array has key "oldkey"!'); try { self::$memcached->resetServerList(); $this->storage->delete('oldkey'); } catch (StorageException $e) { if (count(self::$memcached->getServerList()) == 0) { self::$memcached->addServers(array(array(MEMCACHED_HOST, MEMCACHED_PORT))); } return; } $this->fail('Storage delete exception test failed'); }