Skip to content

Commit 5df912c

Browse files
committed
minor symfony#58206 [Cache] Fix missing class import (derrabus)
This PR was merged into the 6.4 branch. Discussion ---------- [Cache] Fix missing class import | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | N/A | License | MIT This test is supposed to throw PHPUnit's `SkippedTestSuiteError`, but that doesn't work because the class is not imported. Given that this class is marked as internal and that calling `markTestSkipped()` should achieve the same goal, I switched to that method. This is also consistent with other methods in this trait. Commits ------- 9d71219 Fix missing class import
2 parents 82a21a2 + 9d71219 commit 5df912c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,18 @@ public static function provideCreateConnection(): array
9090
public function testPconnectSelectsCorrectDatabase()
9191
{
9292
if (!class_exists(\Redis::class)) {
93-
throw new SkippedTestSuiteError('The "Redis" class is required.');
93+
self::markTestSkipped('The "Redis" class is required.');
9494
}
9595
if (!getenv('REDIS_HOST')) {
96-
throw new SkippedTestSuiteError('REDIS_HOST env var is not defined.');
96+
self::markTestSkipped('REDIS_HOST env var is not defined.');
9797
}
9898
if (!\ini_get('redis.pconnect.pooling_enabled')) {
99-
throw new SkippedTestSuiteError('The bug only occurs when pooling is enabled.');
99+
self::markTestSkipped('The bug only occurs when pooling is enabled.');
100100
}
101101

102102
// Limit the connection pool size to 1:
103103
if (false === $prevPoolSize = ini_set('redis.pconnect.connection_limit', 1)) {
104-
throw new SkippedTestSuiteError('Unable to set pool size');
104+
self::markTestSkipped('Unable to set pool size');
105105
}
106106

107107
try {

0 commit comments

Comments
 (0)