Unverified Commit 30d79671 authored by Jonathan H. Wage's avatar Jonathan H. Wage Committed by Sergei Morozov

Trying to fix DBAL630Test for pgsql.

parent 39f5461c
...@@ -5,6 +5,7 @@ declare(strict_types=1); ...@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Doctrine\Tests\DBAL\Functional\Ticket; namespace Doctrine\Tests\DBAL\Functional\Ticket;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\PDOConnection;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use PDO; use PDO;
...@@ -40,10 +41,9 @@ class DBAL630Test extends DbalFunctionalTestCase ...@@ -40,10 +41,9 @@ class DBAL630Test extends DbalFunctionalTestCase
protected function tearDown() : void protected function tearDown() : void
{ {
if ($this->running) { if ($this->running) {
$wrappedConnection = $this->connection->getWrappedConnection(); $pdo = $this->getPDO();
assert($wrappedConnection instanceof PDO);
$wrappedConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
} }
parent::tearDown(); parent::tearDown();
...@@ -77,10 +77,8 @@ class DBAL630Test extends DbalFunctionalTestCase ...@@ -77,10 +77,8 @@ class DBAL630Test extends DbalFunctionalTestCase
public function testBooleanConversionBoolParamEmulatedPrepares() : void public function testBooleanConversionBoolParamEmulatedPrepares() : void
{ {
$wrappedConnection = $this->connection->getWrappedConnection(); $pdo = $this->getPDO();
assert($wrappedConnection instanceof PDO); $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$wrappedConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$platform = $this->connection->getDatabasePlatform(); $platform = $this->connection->getDatabasePlatform();
...@@ -104,10 +102,8 @@ class DBAL630Test extends DbalFunctionalTestCase ...@@ -104,10 +102,8 @@ class DBAL630Test extends DbalFunctionalTestCase
?bool $statementValue, ?bool $statementValue,
?bool $databaseConvertedValue ?bool $databaseConvertedValue
) : void { ) : void {
$wrappedConnection = $this->connection->getWrappedConnection(); $pdo = $this->getPDO();
assert($wrappedConnection instanceof PDO); $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$wrappedConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$platform = $this->connection->getDatabasePlatform(); $platform = $this->connection->getDatabasePlatform();
...@@ -131,10 +127,8 @@ class DBAL630Test extends DbalFunctionalTestCase ...@@ -131,10 +127,8 @@ class DBAL630Test extends DbalFunctionalTestCase
?bool $statementValue, ?bool $statementValue,
bool $databaseConvertedValue bool $databaseConvertedValue
) : void { ) : void {
$wrappedConnection = $this->connection->getWrappedConnection(); $pdo = $this->getPDO();
assert($wrappedConnection instanceof PDO); $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$wrappedConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$platform = $this->connection->getDatabasePlatform(); $platform = $this->connection->getDatabasePlatform();
...@@ -184,4 +178,12 @@ class DBAL630Test extends DbalFunctionalTestCase ...@@ -184,4 +178,12 @@ class DBAL630Test extends DbalFunctionalTestCase
[null, null], [null, null],
]; ];
} }
private function getPDO() : PDO
{
$wrappedConnection = $this->connection->getWrappedConnection();
assert($wrappedConnection instanceof PDOConnection);
return $wrappedConnection->getWrappedConnection();
}
} }
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