Commit a576a3a6 authored by Marco Pivetta's avatar Marco Pivetta

#714 - Cleaning up test case (dedicated private method for skipped cases)

parent fb96454e
...@@ -15,17 +15,9 @@ class DriverTest extends AbstractPostgreSQLDriverTest ...@@ -15,17 +15,9 @@ class DriverTest extends AbstractPostgreSQLDriverTest
public function testConnectionDisablesPreparesOnPhp56() public function testConnectionDisablesPreparesOnPhp56()
{ {
if (PHP_VERSION_ID < 50600) { $this->skipWhenNotUsingPhp56AndPdoPgsql();
$this->markTestSkipped('Test requires PHP 5.6+');
}
if ($GLOBALS['db_type'] !== 'pdo_pgsql') {
$this->markTestSkipped('Test enabled only when using pdo_pgsql specific phpunit.xml');
}
$driver = $this->createDriver();
$connection = $driver->connect( $connection = $this->createDriver()->connect(
array( array(
'host' => $GLOBALS['db_host'], 'host' => $GLOBALS['db_host'],
'dbname' => $GLOBALS['db_name'], 'dbname' => $GLOBALS['db_name'],
...@@ -46,4 +38,18 @@ class DriverTest extends AbstractPostgreSQLDriverTest ...@@ -46,4 +38,18 @@ class DriverTest extends AbstractPostgreSQLDriverTest
{ {
return new Driver(); return new Driver();
} }
/**
* @throws \PHPUnit_Framework_SkippedTestError
*/
private function skipWhenNotUsingPhp56AndPdoPgsql()
{
if (PHP_VERSION_ID < 50600) {
$this->markTestSkipped('Test requires PHP 5.6+');
}
if ($GLOBALS['db_type'] !== 'pdo_pgsql') {
$this->markTestSkipped('Test enabled only when using pdo_pgsql specific phpunit.xml');
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment