Skip to content

Commit aa29df7

Browse files
committed
Fix test skipping in CI
1 parent 0dfe3c9 commit aa29df7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

tests/DependencyInjection/Compiler/DbalTracingPassTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public function testProcessWithDoctrineDBALVersionAtLeast30(): void
8383

8484
public function testProcessWithDoctrineDBALVersionLowerThan30(): void
8585
{
86-
if (self::isDoctrineDBALVersion3Installed()) {
87-
$this->markTestSkipped('This test requires the version of the "doctrine/dbal" Composer package to be < 3.0.');
86+
if (! self::isDoctrineDBALVersion2Installed()) {
87+
$this->markTestSkipped('This test requires the version of the "doctrine/dbal" Composer package to be ^2.13.');
8888
}
8989

9090
$connection1 = (new Definition(Connection::class))->setPublic(true);
@@ -123,6 +123,10 @@ public function testProcessWithDoctrineDBALVersionLowerThan213OrMissing(): void
123123
*/
124124
public function testProcessDoesNothingIfConditionsForEnablingTracingAreMissing(ContainerBuilder $container): void
125125
{
126+
if (! self::isDoctrineDBALInstalled()) {
127+
$this->markTestSkipped('This test requires the "doctrine/dbal" Composer package.');
128+
}
129+
126130
$connectionConfigDefinition = new Definition();
127131
$connectionConfigDefinition->setClass(Configuration::class);
128132
$connectionConfigDefinition->setPublic(true);

tests/DoctrineTestCase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ protected static function isDoctrineDBALInstalled(): bool
1616
return interface_exists(Driver::class);
1717
}
1818

19+
protected static function isDoctrineDBALVersion2Installed(): bool
20+
{
21+
return self::isDoctrineDBALInstalled()
22+
&& ! self::isDoctrineDBALVersion3Installed();
23+
}
24+
1925
protected static function isDoctrineDBALVersion3Installed(): bool
2026
{
2127
return interface_exists(Middleware::class);

0 commit comments

Comments
 (0)