diff --git a/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php index aa53958cfa..351972da48 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Cache\Tests\Adapter; use Doctrine\DBAL\DriverManager; +use Doctrine\DBAL\Version; use Symfony\Component\Cache\Adapter\PdoAdapter; use Symfony\Component\Cache\Tests\Traits\PdoPruneableTrait; @@ -30,6 +31,10 @@ class PdoDbalAdapterTest extends AdapterTestCase self::markTestSkipped('Extension pdo_sqlite required.'); } + if (\PHP_VERSION_ID >= 80000 && class_exists(Version::class)) { + self::markTestSkipped('Doctrine DBAL 2.x is incompatible with PHP 8.'); + } + self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache'); $pool = new PdoAdapter(DriverManager::getConnection(['driver' => 'pdo_sqlite', 'path' => self::$dbFile])); diff --git a/src/Symfony/Component/Cache/Tests/Simple/PdoDbalCacheTest.php b/src/Symfony/Component/Cache/Tests/Simple/PdoDbalCacheTest.php index 4da2b603cf..79fd97a752 100644 --- a/src/Symfony/Component/Cache/Tests/Simple/PdoDbalCacheTest.php +++ b/src/Symfony/Component/Cache/Tests/Simple/PdoDbalCacheTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Cache\Tests\Simple; use Doctrine\DBAL\DriverManager; +use Doctrine\DBAL\Version; use Symfony\Component\Cache\Simple\PdoCache; use Symfony\Component\Cache\Tests\Traits\PdoPruneableTrait; @@ -30,6 +31,10 @@ class PdoDbalCacheTest extends CacheTestCase self::markTestSkipped('Extension pdo_sqlite required.'); } + if (\PHP_VERSION_ID >= 80000 && class_exists(Version::class)) { + self::markTestSkipped('Doctrine DBAL 2.x is incompatible with PHP 8.'); + } + self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache'); $pool = new PdoCache(DriverManager::getConnection(['driver' => 'pdo_sqlite', 'path' => self::$dbFile]));