1
0
mirror of https://github.com/danog/postgres.git synced 2025-01-10 15:08:29 +01:00
postgres/test/AggregatePoolTest.php
Aaron Piotrowski caf829a48c Initial commit
2016-09-14 09:27:39 -05:00

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;
}
}