mirror of
https://github.com/predis/predis.git
synced 2026-10-07 20:38:06 +00:00
Remove useless argument in Predis\Client::getClientBy().
There was no real meaning to have a callback here, for the most part it
was just a leftover of a previous approach implemented with ee7104d and
quickly superseded by the current approach that simply returns the new
client instance instead of using callbacks.
From feedback to #644.
This commit is contained in:
@@ -725,33 +725,6 @@ class ClientTest extends PredisTestCase
|
||||
$this->assertInstanceOf('SubclassedClient', $client->getClientBy('alias', 'node02'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testGetClientByMethodInvokesCallableInSecondArgumentAndReturnsItsReturnValue()
|
||||
{
|
||||
$test = $this;
|
||||
$client = new Client(array('tcp://host1?alias=node01', 'tcp://host2?alias=node02'), array('cluster' => 'predis'));
|
||||
|
||||
$callable = $this->getMockBuilder('stdClass')
|
||||
->setMethods(array('__invoke'))
|
||||
->getMock();
|
||||
$callable
|
||||
->expects($this->once())
|
||||
->method('__invoke')
|
||||
->with($this->callback(function ($clientNode) use ($test, $client) {
|
||||
$test->isInstanceOf('Predis\ClientInterface', $clientNode);
|
||||
$test->assertNotSame($client, $clientNode);
|
||||
$test->assertInstanceOf('Predis\Connection\NodeConnectionInterface', $connection = $clientNode->getConnection());
|
||||
$test->assertSame('node02', $connection->getParameters()->alias);
|
||||
|
||||
return true;
|
||||
}))
|
||||
->will($this->returnValue('value'));
|
||||
|
||||
$this->assertSame('value', $client->getClientBy('alias', 'node02', $callable));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user