Skip to content

Commit

Permalink
Don't execute tests with DBAL 2.x on php 8.
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed May 23, 2020
1 parent b3cd8ba commit a661719
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Tests/Store/PdoDbalStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\Lock\Tests\Store;

use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Version;
use Symfony\Component\Lock\PersistingStoreInterface;
use Symfony\Component\Lock\Store\PdoStore;

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

if (\PHP_VERSION_ID >= 80000 && class_exists(Version::class)) {
self::markTestSkipped('Doctrine DBAL 2.x is incompatible with PHP 8.');
}

$store = new PdoStore(DriverManager::getConnection(['driver' => 'pdo_sqlite', 'path' => self::$dbFile]));
$store->createTable();
}
Expand Down
5 changes: 5 additions & 0 deletions Tests/Store/PdoStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Lock\Tests\Store;

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

if (\PHP_VERSION_ID >= 80000 && class_exists(Version::class)) {
self::markTestSkipped('Doctrine DBAL 2.x is incompatible with PHP 8.');
}

$store = new PdoStore('sqlite:'.self::$dbFile);
$store->createTable();
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"psr/log": "~1.0"
},
"require-dev": {
"doctrine/dbal": "~2.5",
"doctrine/dbal": "^2.5|^3.0",
"predis/predis": "~1.0"
},
"conflict": {
Expand Down

0 comments on commit a661719

Please sign in to comment.