mirror of
https://github.com/predis/predis.git
synced 2026-10-08 04:46:38 +00:00
[tests] Move utility method into base test class.
This commit is contained in:
@@ -892,30 +892,4 @@ class ClientTest extends PredisTestCase
|
||||
|
||||
return $uriString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a base mocked connection from Predis\Connection\NodeConnectionInterface.
|
||||
*
|
||||
* @param mixed $parameters Optional parameters.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getMockConnection($parameters = null)
|
||||
{
|
||||
$connection = $this->getMock('Predis\Connection\NodeConnectionInterface');
|
||||
|
||||
if ($parameters) {
|
||||
$parameters = \Predis\Connection\Parameters::create($parameters);
|
||||
$hash = "{$parameters->host}:{$parameters->port}";
|
||||
|
||||
$connection->expects($this->any())
|
||||
->method('getParameters')
|
||||
->will($this->returnValue($parameters));
|
||||
$connection->expects($this->any())
|
||||
->method('__toString')
|
||||
->will($this->returnValue($hash));
|
||||
}
|
||||
|
||||
return $connection;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user