2016-04-19 14:51:58 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once('CacheDriverBase.php');
|
|
|
|
|
|
|
|
use Aviat\AnimeClient\Config;
|
|
|
|
use Aviat\Ion\Di\Container;
|
|
|
|
use Aviat\Ion\Cache\Driver\RedisDriver;
|
|
|
|
|
|
|
|
class CacheRedisDriverTestTwo extends AnimeClient_TestCase {
|
|
|
|
use CacheDriverBase;
|
|
|
|
|
|
|
|
protected $driver;
|
|
|
|
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
|
2016-07-22 17:22:00 -04:00
|
|
|
// Setup config with port and password
|
2016-07-27 13:18:52 -04:00
|
|
|
$config = new Config([
|
2016-07-22 17:22:00 -04:00
|
|
|
'redis' => [
|
2016-07-22 17:48:13 -04:00
|
|
|
'host' => (array_key_exists('REDIS_HOST', $_ENV)) ? $_ENV['REDIS_HOST'] : 'localhost',
|
2016-07-22 17:22:00 -04:00
|
|
|
'port' => 6379,
|
|
|
|
'password' => '',
|
|
|
|
'database' => 13,
|
|
|
|
]
|
2016-07-27 13:18:52 -04:00
|
|
|
]);
|
|
|
|
$this->driver = new RedisDriver($config);
|
2016-04-19 14:51:58 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function tearDown()
|
|
|
|
{
|
|
|
|
parent::tearDown();
|
2016-07-18 12:59:34 -04:00
|
|
|
|
|
|
|
if ( ! is_null($this->driver))
|
|
|
|
{
|
|
|
|
$this->driver->__destruct();
|
|
|
|
}
|
2016-04-19 14:51:58 -04:00
|
|
|
}
|
|
|
|
}
|