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