Skip to content

Commit

Permalink
Allow for PDO namespaces pre and post dbal 2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Nov 24, 2020
1 parent 7daab71 commit 4f6bea5
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Doctrine\Migrations\Tests\Tools\Console\Command;

use DateTimeImmutable;
use Doctrine\DBAL\Version as DBALVersion;
use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Connection\ExistingConnection;
use Doctrine\Migrations\Configuration\Migration\ExistingConfiguration;
Expand Down Expand Up @@ -73,6 +74,12 @@ public function testExecute(): void

$lines = array_map('trim', explode("\n", trim($this->commandTester->getDisplay(true))));

if (DBALVersion::compare('2.11.0') > 0) {
$databaseDriver = 'Doctrine\DBAL\Driver\PDOSqlite\Driver '; // Trailing space bufferes outout assertion
} else {
$databaseDriver = 'Doctrine\DBAL\Driver\PDO\SQLite\Driver';
}

self::assertSame(
[
'+----------------------+----------------------+------------------------------------------------------------------------+',
Expand All @@ -82,7 +89,7 @@ public function testExecute(): void
'| | Table Name | doctrine_migration_versions |',
'| | Column Name | version |',
'|----------------------------------------------------------------------------------------------------------------------|',
'| Database | Driver | Doctrine\DBAL\Driver\PDOSqlite\Driver |',
'| Database | Driver | ' . $databaseDriver . ' |',
'| | Name | |',
'|----------------------------------------------------------------------------------------------------------------------|',
'| Versions | Previous | 1230 |',
Expand Down

0 comments on commit 4f6bea5

Please sign in to comment.