minor #36895 Skip Doctrine DBAL on php 8 until we have a compatible version (derrabus)

This PR was merged into the 3.4 branch.

Discussion
----------

Skip Doctrine DBAL on php 8 until we have a compatible version

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

This PR skips all tests on php 8 that would trigger an autoload on DBAL's `PDOConnection`. Those tests would exit with a fatal error because of incompatible method signatures (see doctrine/dbal#3791) and until we can test against a compatible version of DBAL, there's (at least from my point of view) nothing we can do about it. Once this issue is resolved, we can revert this change.

Commits
-------

1090738264 Skip Doctrine DBAL on php 8 until we have a compatible version.
This commit is contained in:
Nicolas Grekas 2020-05-23 10:29:15 +02:00
commit 2799d559f3
7 changed files with 39 additions and 1 deletions

View File

@ -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();

View File

@ -23,6 +23,13 @@ use Symfony\Bridge\Doctrine\Tests\Fixtures\User;
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();

View File

@ -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();

View File

@ -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;

View File

@ -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]));

View File

@ -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]));

View File

@ -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": {