cache = CacheDriverFactory::create('memcached'); } catch (\Exception $exception) { throw new \Exception("Memcached - TestCase failed: " . $exception->getMessage(), $exception->getCode(), $exception); } return $this->cache; } else { $this->markTestSkipped('Memcached driver isn\'t available'); return null; } } public function tearDown() { if (class_exists('Memcached')) { $this->cache->clear(false); } parent::tearDown(); } }