8000 [Cache][Lock][Messenger] Don't execute tests with DBAL 2.x on php 8 by derrabus · Pull Request #36927 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Cache][Lock][Messenger] Don't execute tests with DBAL 2.x on php 8 #36927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Symfony/Component/Cache/Tests/Adapter/PdoAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Cache\Tests\Adapter;

use Doctrine\DBAL\Version;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\PdoAdapter;
use Symfony\Component\Cache\Tests\Traits\PdoPruneableTrait;
Expand All @@ -30,6 +31,10 @@ public static function setUpBeforeClass(): void
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('sqlite:'.self::$dbFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\Cache\Tests\Adapter;

use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Version;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\PdoAdapter;
use Symfony\Component\Cache\Tests\Traits\PdoPruneableTrait;
Expand All @@ -31,6 +32,10 @@ public static function setUpBeforeClass(): void
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');
}

Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Component/Cache/Tests/Simple/PdoDbalCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\Cache\Tests\Simple;

use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Version;
use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Cache\Simple\PdoCache;
use Symfony\Component\Cache\Tests\Traits\PdoPruneableTrait;
Expand All @@ -32,6 +33,10 @@ public static function setUpBeforeClass(): void
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]));
Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Component/Lock/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 src/Symfony/Component/Lock/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 src/Symfony/Component/Lock/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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\Messenger\Tests\Transport\Doctrine;

use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Version;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Transport\Doctrine\Connection;
Expand All @@ -28,6 +29,13 @@ class DoctrineIntegrationTest extends TestCase
/** @var string */
private $sqliteFile;

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

protected function setUp(): void
{
$this->sqliteFile = sys_get_temp_dir().'/symfony.messenger.sqlite';
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Messenger/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.6",
"doctrine/dbal": "^2.6|^3.0",
"psr/cache": "~1.0",
"doctrine/persistence": "^1.3",
"symfony/console": "^3.4|^4.0|^5.0",
Expand Down
0