Skip to content

Commit 246f802

Browse files
jderussefabpot
authored andcommitted
Fix SkippedTestSuite
1 parent fc4d960 commit 246f802

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

Tests/Store/MemcachedStoreTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Lock\Tests\Store;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use Symfony\Component\Lock\Exception\InvalidTtlException;
1516
use Symfony\Component\Lock\Key;
1617
use Symfony\Component\Lock\PersistingStoreInterface;
@@ -34,7 +35,7 @@ public static function setUpBeforeClass(): void
3435
$code = $memcached->getResultCode();
3536

3637
if (\Memcached::RES_SUCCESS !== $code && \Memcached::RES_NOTFOUND !== $code) {
37-
self::markTestSkipped('Unable to connect to the memcache host');
38+
throw new SkippedTestSuiteError('Unable to connect to the memcache host');
3839
}
3940
}
4041

Tests/Store/PredisStoreTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Lock\Tests\Store;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
15+
1416
/**
1517
* @author Jérémy Derussé <jeremy@derusse.com>
1618
* @group integration
@@ -23,7 +25,7 @@ public static function setUpBeforeClass(): void
2325
try {
2426
$redis->connect();
2527
} catch (\Exception $e) {
26-
self::markTestSkipped($e->getMessage());
28+
throw new SkippedTestSuiteError($e->getMessage());
2729
}
2830
}
2931

Tests/Store/RedisArrayStoreTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Lock\Tests\Store;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
15+
1416
/**
1517
* @author Jérémy Derussé <jeremy@derusse.com>
1618
*
@@ -22,12 +24,12 @@ class RedisArrayStoreTest extends AbstractRedisStoreTest
2224
public static function setUpBeforeClass(): void
2325
{
2426
if (!class_exists(\RedisArray::class)) {
25-
self::markTestSkipped('The RedisArray class is required.');
27+
throw new SkippedTestSuiteError('The RedisArray class is required.');
2628
}
2729
try {
2830
(new \Redis())->connect(getenv('REDIS_HOST'));
2931
} catch (\Exception $e) {
30-
self::markTestSkipped($e->getMessage());
32+
throw new SkippedTestSuiteError($e->getMessage());
3133
}
3234
}
3335

Tests/Store/RedisClusterStoreTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Lock\Tests\Store;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
15+
1416
/**
1517
* @author Jérémy Derussé <jeremy@derusse.com>
1618
*
@@ -22,10 +24,10 @@ class RedisClusterStoreTest extends AbstractRedisStoreTest
2224
public static function setUpBeforeClass(): void
2325
{
2426
if (!class_exists(\RedisCluster::class)) {
25-
self::markTestSkipped('The RedisCluster class is required.');
27+
throw new SkippedTestSuiteError('The RedisCluster class is required.');
2628
}
2729
if (!getenv('REDIS_CLUSTER_HOSTS')) {
28-
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
30+
throw new SkippedTestSuiteError('REDIS_CLUSTER_HOSTS env var is not defined.');
2931
}
3032
}
3133

Tests/Store/RedisStoreTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Lock\Tests\Store;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use Symfony\Component\Lock\Exception\InvalidTtlException;
1516
use Symfony\Component\Lock\Store\RedisStore;
1617

@@ -27,7 +28,7 @@ public static function setUpBeforeClass(): void
2728
try {
2829
(new \Redis())->connect(getenv('REDIS_HOST'));
2930
} catch (\Exception $e) {
30-
self::markTestSkipped($e->getMessage());
31+
throw new SkippedTestSuiteError($e->getMessage());
3132
}
3233
}
3334

0 commit comments

Comments
 (0)