mirror of
https://github.com/danog/postgres.git
synced 2025-01-10 06:58:20 +01:00
32 lines
825 B
PHP
32 lines
825 B
PHP
|
<?php declare(strict_types = 1);
|
||
|
|
||
|
namespace Amp\Postgres\Test;
|
||
|
|
||
|
use Amp\Postgres\AggregatePool;
|
||
|
|
||
|
class AggregatePoolTest extends AbstractPoolTest
|
||
|
{
|
||
|
/**
|
||
|
* @param array $connections
|
||
|
*
|
||
|
* @return \Amp\Postgres\Pool
|
||
|
*/
|
||
|
protected function createPool(array $connections) {
|
||
|
$mock = $this->getMockBuilder(AggregatePool::class)
|
||
|
->setConstructorArgs(['', 0, count($connections)])
|
||
|
->setMethods(['createConnection'])
|
||
|
->getMock();
|
||
|
|
||
|
$mock->method('createConnection')
|
||
|
->will($this->returnCallback(function () {
|
||
|
$this->fail('The createConnection() method should not be called.');
|
||
|
}));
|
||
|
|
||
|
foreach ($connections as $connection) {
|
||
|
$mock->addConnection($connection);
|
||
|
}
|
||
|
|
||
|
return $mock;
|
||
|
}
|
||
|
}
|