Commit fb96454e authored by Marco Pivetta's avatar Marco Pivetta

#714 - Adding a test verifying that attribute...

#714 - Adding a test verifying that attribute `PDO::PGSQL_ATTR_DISABLE_PREPARES` is set when using pgsql on PHP 5.6+
parent dfd4dde8
...@@ -4,6 +4,7 @@ namespace Doctrine\Tests\DBAL\Driver\PDOPgSql; ...@@ -4,6 +4,7 @@ namespace Doctrine\Tests\DBAL\Driver\PDOPgSql;
use Doctrine\DBAL\Driver\PDOPgSql\Driver; use Doctrine\DBAL\Driver\PDOPgSql\Driver;
use Doctrine\Tests\DBAL\Driver\AbstractPostgreSQLDriverTest; use Doctrine\Tests\DBAL\Driver\AbstractPostgreSQLDriverTest;
use PDO;
class DriverTest extends AbstractPostgreSQLDriverTest class DriverTest extends AbstractPostgreSQLDriverTest
{ {
...@@ -12,6 +13,35 @@ class DriverTest extends AbstractPostgreSQLDriverTest ...@@ -12,6 +13,35 @@ class DriverTest extends AbstractPostgreSQLDriverTest
$this->assertSame('pdo_pgsql', $this->driver->getName()); $this->assertSame('pdo_pgsql', $this->driver->getName());
} }
public function testConnectionDisablesPreparesOnPhp56()
{
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');
}
$driver = $this->createDriver();
$connection = $driver->connect(
array(
'host' => $GLOBALS['db_host'],
'dbname' => $GLOBALS['db_name'],
'port' => $GLOBALS['db_port']
),
$GLOBALS['db_username'],
$GLOBALS['db_password']
);
$this->assertInstanceOf('Doctrine\DBAL\Driver\PDOConnection', $connection);
$this->assertTrue($connection->getAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES));
}
/**
* {@inheritDoc}
*/
protected function createDriver() protected function createDriver()
{ {
return new Driver(); return new Driver();
......
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