Skip to content

Commit a661719

Browse files
committed
Don't execute tests with DBAL 2.x on php 8.
1 parent b3cd8ba commit a661719

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Tests/Store/PdoDbalStoreTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Lock\Tests\Store;
1313

1414
use Doctrine\DBAL\DriverManager;
15+
use Doctrine\DBAL\Version;
1516
use Symfony\Component\Lock\PersistingStoreInterface;
1617
use Symfony\Component\Lock\Store\PdoStore;
1718

@@ -30,6 +31,10 @@ public static function setUpBeforeClass(): void
3031
{
3132
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_lock');
3233

34+
if (\PHP_VERSION_ID >= 80000 && class_exists(Version::class)) {
35+
self::markTestSkipped('Doctrine DBAL 2.x is incompatible with PHP 8.');
36+
}
37+
3338
$store = new PdoStore(DriverManager::getConnection(['driver' => 'pdo_sqlite', 'path' => self::$dbFile]));
3439
$store->createTable();
3540
}

Tests/Store/PdoStoreTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Lock\Tests\Store;
1313

14+
use Doctrine\DBAL\Version;
1415
use Symfony\Component\Lock\Key;
1516
use Symfony\Component\Lock\PersistingStoreInterface;
1617
use Symfony\Component\Lock\Store\PdoStore;
@@ -30,6 +31,10 @@ public static function setUpBeforeClass(): void
3031
{
3132
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_lock');
3233

34+
if (\PHP_VERSION_ID >= 80000 && class_exists(Version::class)) {
35+
self::markTestSkipped('Doctrine DBAL 2.x is incompatible with PHP 8.');
36+
}
37+
3338
$store = new PdoStore('sqlite:'.self::$dbFile);
3439
$store->createTable();
3540
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"psr/log": "~1.0"
2121
},
2222
"require-dev": {
23-
"doctrine/dbal": "~2.5",
23+
"doctrine/dbal": "^2.5|^3.0",
2424
"predis/predis": "~1.0"
2525
},
2626
"conflict": {

0 commit comments

Comments
 (0)