|
@ -50,29 +50,29 @@ class RedisManagerTest extends PHPUnit_Framework_TestCase |
|
|
|
|
|
|
|
|
public function testConnectWrongPersistantConfig() |
|
|
public function testConnectWrongPersistantConfig() |
|
|
{ |
|
|
{ |
|
|
$this->setExpectedException('GeneralException', 'Connection parameters must be an array'); |
|
|
|
|
|
Config::set('Redis', array('new' => 'some')); |
|
|
Config::set('Redis', array('new' => 'some')); |
|
|
|
|
|
$this->setExpectedException('GeneralException', 'Connection parameters must be an array'); |
|
|
RedisManager::connect('new'); |
|
|
RedisManager::connect('new'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function testConnectDefaultConfig() |
|
|
public function testConnectDefaultConfig() |
|
|
{ |
|
|
{ |
|
|
$this->setExpectedException('GeneralException', 'Connection parameters must be an array'); |
|
|
|
|
|
Config::set('Redis', array('default' => 'some')); |
|
|
Config::set('Redis', array('default' => 'some')); |
|
|
|
|
|
$this->setExpectedException('GeneralException', 'Connection parameters must be an array'); |
|
|
RedisManager::connect(); |
|
|
RedisManager::connect(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function testConnectFailedConnection() |
|
|
public function testConnectFailedConnection() |
|
|
{ |
|
|
{ |
|
|
$this->setExpectedException('GeneralException', 'Failed to connect to Redis server at'); |
|
|
|
|
|
Config::set('Redis', array('new' => array('host' => 'error', 'port' => 2023, 'database' => 'some'))); |
|
|
Config::set('Redis', array('new' => array('host' => 'error', 'port' => 2023, 'database' => 'some'))); |
|
|
|
|
|
$this->setExpectedException('GeneralException', 'Failed to connect to Redis server at'); |
|
|
RedisManager::connect('new'); |
|
|
RedisManager::connect('new'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function testConnectEstablishedConnectionNoDb() |
|
|
public function testConnectEstablishedConnectionNoDb() |
|
|
{ |
|
|
{ |
|
|
$this->setExpectedException('GeneralException', 'Failed to select Redis database with index'); |
|
|
|
|
|
Config::set('Redis', array('new' => array('host' => true, 'port' => 2023, 'database' => 'some'))); |
|
|
Config::set('Redis', array('new' => array('host' => true, 'port' => 2023, 'database' => 'some'))); |
|
|
|
|
|
$this->setExpectedException('GeneralException', 'Failed to select Redis database with index'); |
|
|
RedisManager::connect('new'); |
|
|
RedisManager::connect('new'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|