Skip to content

Commit

Permalink
Merge pull request #3549 from morozov/issues/3487
Browse files Browse the repository at this point in the history
Removed the assertion which doesn't work with a user-provided PDO connection
  • Loading branch information
morozov authored May 22, 2019
2 parents 06d1d8c + 6820036 commit 9e086fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/Doctrine/DBAL/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,6 @@ public function rollbackSavepoint($savepoint)
public function getWrappedConnection()
{
$this->connect();
assert($this->_conn instanceof DriverConnection);

return $this->_conn;
}
Expand Down
13 changes: 13 additions & 0 deletions tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Doctrine\Tests\DbalFunctionalTestCase;
use Error;
use Exception;
use PDO;
use RuntimeException;
use Throwable;
use function in_array;
Expand Down Expand Up @@ -311,4 +312,16 @@ public function testDeterminesDatabasePlatformWhenConnectingToNonExistentDatabas

$connection->close();
}

/**
* @requires extension pdo_sqlite
*/
public function testUserProvidedPDOConnection() : void
{
self::assertTrue(
DriverManager::getConnection([
'pdo' => new PDO('sqlite::memory:'),
])->ping()
);
}
}

0 comments on commit 9e086fe

Please sign in to comment.