1
0
mirror of https://github.com/danog/postgres.git synced 2025-01-10 06:58:20 +01:00
postgres/test/AggregatePoolTest.php

32 lines
825 B
PHP
Raw Normal View History

2016-09-14 16:27:39 +02:00
<?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;
}
}