|
@@ -61,6 +61,27 @@ class ClientConnectionFactoryTest extends StandardTestCase
|
|
$this->assertSame($value, $option->filter($options, $value));
|
|
$this->assertSame($value, $option->filter($options, $value));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @group disconnected
|
|
|
|
+ */
|
|
|
|
+ public function testValidationAcceptsCallableObjectAsInitializers()
|
|
|
|
+ {
|
|
|
|
+ $value = $this->getMock('Predis\Connection\ConnectionFactoryInterface');
|
|
|
|
+ $options = $this->getMock('Predis\Option\ClientOptionsInterface');
|
|
|
|
+ $option = new ClientConnectionFactory();
|
|
|
|
+
|
|
|
|
+ $initializer = $this->getMock('stdClass', array('__invoke'));
|
|
|
|
+ $initializer->expects($this->once())
|
|
|
|
+ ->method('__invoke')
|
|
|
|
+ ->with($this->isInstanceOf('Predis\Option\ClientOptionsInterface'), $option)
|
|
|
|
+ ->will($this->returnValue($value));
|
|
|
|
+
|
|
|
|
+ $cluster = $option->filter($options, $initializer, $option);
|
|
|
|
+
|
|
|
|
+ $this->assertInstanceOf('Predis\Connection\ConnectionFactoryInterface', $cluster);
|
|
|
|
+ $this->assertSame($value, $cluster);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @group disconnected
|
|
* @group disconnected
|
|
*/
|
|
*/
|