From 87809b70d1b779fb81c0f05c9ac425568aaa670f Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Tue, 20 Sep 2016 00:47:16 -0500 Subject: [PATCH] Test and formatting updates --- test/AggregatePoolTest.php | 3 +-- test/ConnectionPoolTest.php | 3 +-- test/FunctionsTest.php | 9 +++++++-- test/PgSqlConnectionTest.php | 3 +++ test/PqConnectionTest.php | 3 +++ 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/test/AggregatePoolTest.php b/test/AggregatePoolTest.php index 16ece97..bbdab60 100644 --- a/test/AggregatePoolTest.php +++ b/test/AggregatePoolTest.php @@ -4,8 +4,7 @@ namespace Amp\Postgres\Test; use Amp\Postgres\AggregatePool; -class AggregatePoolTest extends AbstractPoolTest -{ +class AggregatePoolTest extends AbstractPoolTest { /** * @param array $connections * diff --git a/test/ConnectionPoolTest.php b/test/ConnectionPoolTest.php index f09e542..d55fe06 100644 --- a/test/ConnectionPoolTest.php +++ b/test/ConnectionPoolTest.php @@ -6,8 +6,7 @@ use Amp\Postgres\ConnectionPool; use Amp\Success; use Interop\Async\Awaitable; -class ConnectionPoolTest extends AbstractPoolTest -{ +class ConnectionPoolTest extends AbstractPoolTest { /** * @param array $connections * diff --git a/test/FunctionsTest.php b/test/FunctionsTest.php index de19109..5b597a3 100644 --- a/test/FunctionsTest.php +++ b/test/FunctionsTest.php @@ -4,8 +4,13 @@ namespace Amp\Postgres\Test; use Amp\Postgres\{ Connection, function connect }; -class FunctionsTest extends \PHPUnit_Framework_TestCase -{ +class FunctionsTest extends \PHPUnit_Framework_TestCase { + public function setUp() { + if (!\extension_loaded('pgsql') && !\extension_loaded('pq')) { + $this->markTestSkipped('This test requires either ext/pgsql or pecl/pq'); + } + } + public function testConnect() { \Amp\execute(function () { $connection = yield connect('host=localhost user=postgres', 1); diff --git a/test/PgSqlConnectionTest.php b/test/PgSqlConnectionTest.php index 9c56772..5434072 100644 --- a/test/PgSqlConnectionTest.php +++ b/test/PgSqlConnectionTest.php @@ -4,6 +4,9 @@ namespace Amp\Postgres\Test; use Amp\Postgres\{ Connection, PgSqlConnection }; +/** + * @requires extension pgsql + */ class PgSqlConnectionTest extends AbstractConnectionTest { /** @var resource PostgreSQL connection resource. */ protected $handle; diff --git a/test/PqConnectionTest.php b/test/PqConnectionTest.php index b112f46..9946fb6 100644 --- a/test/PqConnectionTest.php +++ b/test/PqConnectionTest.php @@ -4,6 +4,9 @@ namespace Amp\Postgres\Test; use Amp\Postgres\{ Connection, PqConnection }; +/** + * @requires extension pq + */ class PqConnectionTest extends AbstractConnectionTest { /** @var resource PostgreSQL connection resource. */ protected $handle;