Unverified Commit 9e086feb authored by Sergei Morozov's avatar Sergei Morozov Committed by GitHub

Merge pull request #3549 from morozov/issues/3487

Removed the assertion which doesn't work with a user-provided PDO connection
parents 06d1d8c3 68200369
...@@ -1429,7 +1429,6 @@ class Connection implements DriverConnection ...@@ -1429,7 +1429,6 @@ class Connection implements DriverConnection
public function getWrappedConnection() public function getWrappedConnection()
{ {
$this->connect(); $this->connect();
assert($this->_conn instanceof DriverConnection);
return $this->_conn; return $this->_conn;
} }
......
...@@ -12,6 +12,7 @@ use Doctrine\DBAL\Types\Types; ...@@ -12,6 +12,7 @@ use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use Error; use Error;
use Exception; use Exception;
use PDO;
use RuntimeException; use RuntimeException;
use Throwable; use Throwable;
use function in_array; use function in_array;
...@@ -311,4 +312,16 @@ class ConnectionTest extends DbalFunctionalTestCase ...@@ -311,4 +312,16 @@ class ConnectionTest extends DbalFunctionalTestCase
$connection->close(); $connection->close();
} }
/**
* @requires extension pdo_sqlite
*/
public function testUserProvidedPDOConnection() : void
{
self::assertTrue(
DriverManager::getConnection([
'pdo' => new PDO('sqlite::memory:'),
])->ping()
);
}
} }
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