Removed the assertion which doesn't work with a user-provided PDO connection

parent 06d1d8c3
......@@ -1429,7 +1429,6 @@ class Connection implements DriverConnection
public function getWrappedConnection()
{
$this->connect();
assert($this->_conn instanceof DriverConnection);
return $this->_conn;
}
......
......@@ -12,6 +12,7 @@ use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\DbalFunctionalTestCase;
use Error;
use Exception;
use PDO;
use RuntimeException;
use Throwable;
use function in_array;
......@@ -311,4 +312,16 @@ class ConnectionTest extends DbalFunctionalTestCase
$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