From 1090738264e0ebc816ede60f42365c8694b8b165 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 22 May 2020 09:54:48 +0200 Subject: [PATCH] Skip Doctrine DBAL on php 8 until we have a compatible version. --- .../Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php | 7 +++++++ .../Tests/Security/User/EntityUserProviderTest.php | 7 +++++++ .../Validator/Constraints/UniqueEntityValidatorTest.php | 7 +++++++ .../SecurityBundle/Tests/Functional/SetAclCommandTest.php | 7 +++++++ .../Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php | 5 +++++ .../Component/Cache/Tests/Simple/PdoDbalCacheTest.php | 5 +++++ src/Symfony/Component/Cache/composer.json | 2 +- 7 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php index 7bb57d707ddd8..4d5691e22333a 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php @@ -61,6 +61,13 @@ class EntityTypeTest extends BaseTypeTest protected static $supportedFeatureSetVersion = 304; + public static function setUpBeforeClass() + { + if (\PHP_VERSION_ID >= 80000) { + self::markTestSkipped('Doctrine DBAL 2.x is incompatible with PHP 8.'); + } + } + protected function setUp() { $this->em = DoctrineTestHelper::createTestEntityManager(); diff --git a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php index 8916f8fb929e0..e43940d85c32d 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php @@ -23,6 +23,13 @@ class EntityUserProviderTest extends TestCase { + public static function setUpBeforeClass() + { + if (\PHP_VERSION_ID >= 80000) { + self::markTestSkipped('Doctrine DBAL 2.x is incompatible with PHP 8.'); + } + } + public function testRefreshUserGetsUserByPrimaryKey() { $em = DoctrineTestHelper::createTestEntityManager(); diff --git a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php index 77d15999905ba..ba772e58fd047 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php @@ -63,6 +63,13 @@ class UniqueEntityValidatorTest extends ConstraintValidatorTestCase protected $repositoryFactory; + public static function setUpBeforeClass() + { + if (\PHP_VERSION_ID >= 80000) { + self::markTestSkipped('Doctrine DBAL 2.x is incompatible with PHP 8.'); + } + } + protected function setUp() { $this->repositoryFactory = new TestRepositoryFactory(); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php index 8eb70c09c1ed7..892a51f9bd27c 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php @@ -40,6 +40,13 @@ class SetAclCommandTest extends AbstractWebTestCase const OBJECT_CLASS = 'Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AclBundle\Entity\Car'; const SECURITY_CLASS = 'Symfony\Component\Security\Core\User\User'; + public static function setUpBeforeClass() + { + if (\PHP_VERSION_ID >= 80000) { + self::markTestSkipped('Doctrine DBAL 2.x is incompatible with PHP 8.'); + } + } + public function testSetAclUser() { $objectId = 1; diff --git a/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php index aa53958cfab32..351972da48691 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 @@ public static function setUpBeforeClass() 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 4da2b603cf88f..79fd97a752a2e 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 @@ public static function setUpBeforeClass() 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])); diff --git a/src/Symfony/Component/Cache/composer.json b/src/Symfony/Component/Cache/composer.json index e13cd9675160f..3d82799e00324 100644 --- a/src/Symfony/Component/Cache/composer.json +++ b/src/Symfony/Component/Cache/composer.json @@ -29,7 +29,7 @@ "require-dev": { "cache/integration-tests": "dev-master", "doctrine/cache": "~1.6", - "doctrine/dbal": "~2.4", + "doctrine/dbal": "~2.4|~3.0", "predis/predis": "~1.0" }, "conflict": {