Skip to content

Commit

Permalink
Updated the mock init logic in strategy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nick committed Jan 12, 2024
1 parent c8c82b0 commit 8229f5e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/Manticoresearch/Connection/Strategy/RandomTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ public function testSequenceGood()

$mConns = [];
for ($i=0; $i<10; $i++) {
$mConns[] = mock::mock(\Manticoresearch\Connection::class)
->shouldReceive('isAlive')->andReturn(true)->getMock();
$mock = mock::mock(\Manticoresearch\Connection::class);
$mock->shouldReceive('isAlive')->andReturn(true);
$mock->shouldReceive('getHost')->andReturn($_SERVER['MS_HOST']);
$mock->shouldReceive('getPort')->andReturn((int)($_SERVER['MS_PORT']));
$mConns[] = $mock->getMock();
}
$connectionPool = new \Manticoresearch\Connection\ConnectionPool(
$mConns,
Expand Down

0 comments on commit 8229f5e

Please sign in to comment.