*/ namespace Desarrolla2\Test\Cache; use Desarrolla2\Cache\Predis as PredisCache; use Predis\Client; use Predis\Connection\ConnectionException; /** * PredisTest */ class PredisTest extends AbstractCacheTest { /** * @var Client */ protected $client; public function createSimpleCache() { if (!class_exists('Predis\Client')) { $this->markTestSkipped('The predis library is not available'); } try { $this->client = new Client(CACHE_TESTS_PREDIS_DSN, ['exceptions' => false]); $this->client->connect(); } catch (ConnectionException $e) { $this->markTestSkipped($e->getMessage()); } return new PredisCache($this->client); } public function tearDown(): void { parent::tearDown(); $this->client->disconnect(); } }