cache = CacheDriverFactory::create('memcached'); } catch (\Exception $exception) { print "Memcached - TestCase failed: " . $exception->getMessage(); throw new \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(); } }