mirror of
https://github.com/danog/postgres.git
synced 2024-11-26 12:04:50 +01:00
Fix Transaction; Fix tests; Remove extension repo directories after install on travis
This commit is contained in:
parent
0472d5d560
commit
660209270d
@ -10,6 +10,7 @@ use Amp\Loop;
|
||||
use Amp\Promise;
|
||||
use Amp\Sql\ConnectionException;
|
||||
use Amp\Sql\FailureException;
|
||||
use Amp\Sql\QueryError;
|
||||
use Amp\Success;
|
||||
use pq;
|
||||
use function Amp\call;
|
||||
|
@ -81,7 +81,7 @@ final class Transaction implements Handle, SqlTransaction
|
||||
*/
|
||||
public function isAlive(): bool
|
||||
{
|
||||
return $this->handle->isAlive();
|
||||
return $this->handle && $this->handle->isAlive();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -103,7 +103,7 @@ abstract class AbstractLinkTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException QueryError
|
||||
* @expectedException \Amp\Sql\QueryError
|
||||
*/
|
||||
public function testQueryWithEmptyQuery()
|
||||
{
|
||||
@ -669,7 +669,7 @@ abstract class AbstractLinkTest extends TestCase
|
||||
|
||||
/**
|
||||
* @depends testListen
|
||||
* @expectedException QueryError
|
||||
* @expectedException \Amp\Sql\QueryError
|
||||
* @expectedExceptionMessage Already listening on channel
|
||||
*/
|
||||
public function testListenOnSameChannel()
|
||||
|
@ -4,6 +4,7 @@ namespace Amp\Postgres\Test;
|
||||
|
||||
use Amp\Postgres\ConnectionConfig;
|
||||
use Amp\Postgres\Link;
|
||||
use Amp\Postgres\PgSqlConnection;
|
||||
use Amp\Postgres\Pool;
|
||||
use Amp\Promise;
|
||||
use Amp\Sql\Connector;
|
||||
@ -32,8 +33,9 @@ class PgSqlPoolTest extends AbstractLinkTest
|
||||
if (!isset($this->handles[$count])) {
|
||||
$this->fail("createConnection called too many times");
|
||||
}
|
||||
$handle = $this->handles[$count];
|
||||
++$count;
|
||||
return new Success();
|
||||
return new Success(new PgSqlConnection($handle, \pg_socket($handle)));
|
||||
}));
|
||||
|
||||
$pool = new Pool(new ConnectionConfig('connection string'), \count($this->handles), $connector);
|
||||
|
@ -4,11 +4,11 @@ namespace Amp\Postgres\Test;
|
||||
|
||||
use Amp\Delayed;
|
||||
use Amp\Loop;
|
||||
use Amp\Postgres\Pool;
|
||||
use Amp\Postgres\ConnectionConfig;
|
||||
use Amp\Postgres\Pool;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DefaultPoolTest extends TestCase
|
||||
class PoolTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException \Error
|
||||
|
@ -8,3 +8,4 @@ make;
|
||||
make install;
|
||||
popd;
|
||||
echo "extension=pq.so" >> "$(php -r 'echo php_ini_loaded_file();')";
|
||||
rm -rf ext-pq
|
||||
|
@ -8,3 +8,4 @@ make;
|
||||
make install;
|
||||
popd;
|
||||
echo "extension=raphf.so" >> "$(php -r 'echo php_ini_loaded_file();')";
|
||||
rm -rf ext-raphf
|
||||
|
Loading…
Reference in New Issue
Block a user