Skip to content

Commit

Permalink
Add compatibility to doctrine/dbal 2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jul 5, 2024
1 parent 0c34feb commit cf0a55e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
phpunit.xml
vendor/
composer.lock
.phpunit.cache/
.idea/
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"php": ">=8.1",
"doctrine/lexer": "^2.0|^3.0",
"doctrine/orm": "^2.19|^3.0",
"doctrine/dbal": "^3.3|^4.0"
"doctrine/dbal": "^2.13|^3.3|^4.0"
},
"require-dev": {
"phpunit/phpunit": "~10",
"phpunit/phpunit": "^10|^11",
"doctrine/data-fixtures": "^1.6",
"symfony/yaml": "^5|^6|^7",
"symfony/cache": "^5|^6|^7",
Expand Down
5 changes: 5 additions & 0 deletions tests/Oro/Tests/Connection/TestUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ public static function getPlatformName(): string

$platform = $entityManager->getConnection()->getDatabasePlatform();

if (\method_exists($platform, 'getName')) {
// BC Layer for doctrine/dbal 2 can be removed when require doctrine/dbal 3 as min version
return $platform->getName();
}

if ($platform instanceof AbstractMySQLPlatform) {
return 'mysql';
} elseif ($platform instanceof PostgreSQLPlatform) {
Expand Down

0 comments on commit cf0a55e

Please sign in to comment.