Make connection factory mandatory for RedisCluster constructor.

This commit is contained in:
Daniele Alessandri
2014-07-23 11:13:09 +02:00
parent 6147f34478
commit fdf5894022
3 changed files with 32 additions and 24 deletions
@@ -47,7 +47,14 @@ class ClusterOptionTest extends PredisTestCase
public function testAcceptsPredefinedShortNameString()
{
$option = new ClusterOption();
$options = $this->getMock('Predis\Configuration\OptionsInterface');
$options->expects($this->any())
->method('__get')
->with('connections')
->will($this->returnValue(
$this->getMock('Predis\Connection\FactoryInterface')
));
$this->assertInstanceOf('Predis\Connection\Aggregate\PredisCluster', $option->filter($options, 'predis'));
$this->assertInstanceOf('Predis\Connection\Aggregate\PredisCluster', $option->filter($options, 'predis-cluster'));