diff --git a/Tests/Store/MemcachedStoreTest.php b/Tests/Store/MemcachedStoreTest.php index fa93d0c..a0b308d 100644 --- a/Tests/Store/MemcachedStoreTest.php +++ b/Tests/Store/MemcachedStoreTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Lock\Tests\Store; +use PHPUnit\Framework\SkippedTestSuiteError; use Symfony\Component\Lock\Exception\InvalidTtlException; use Symfony\Component\Lock\Key; use Symfony\Component\Lock\PersistingStoreInterface; @@ -34,7 +35,7 @@ public static function setUpBeforeClass(): void $code = $memcached->getResultCode(); if (\Memcached::RES_SUCCESS !== $code && \Memcached::RES_NOTFOUND !== $code) { - self::markTestSkipped('Unable to connect to the memcache host'); + throw new SkippedTestSuiteError('Unable to connect to the memcache host'); } } diff --git a/Tests/Store/PredisStoreTest.php b/Tests/Store/PredisStoreTest.php index 9771d6e..179a824 100644 --- a/Tests/Store/PredisStoreTest.php +++ b/Tests/Store/PredisStoreTest.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Lock\Tests\Store; +use PHPUnit\Framework\SkippedTestSuiteError; + /** * @author Jérémy Derussé * @group integration @@ -23,7 +25,7 @@ public static function setUpBeforeClass(): void try { $redis->connect(); } catch (\Exception $e) { - self::markTestSkipped($e->getMessage()); + throw new SkippedTestSuiteError($e->getMessage()); } } diff --git a/Tests/Store/RedisArrayStoreTest.php b/Tests/Store/RedisArrayStoreTest.php index d5074a3..3b194d7 100644 --- a/Tests/Store/RedisArrayStoreTest.php +++ b/Tests/Store/RedisArrayStoreTest.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Lock\Tests\Store; +use PHPUnit\Framework\SkippedTestSuiteError; + /** * @author Jérémy Derussé * @@ -22,12 +24,12 @@ class RedisArrayStoreTest extends AbstractRedisStoreTest public static function setUpBeforeClass(): void { if (!class_exists(\RedisArray::class)) { - self::markTestSkipped('The RedisArray class is required.'); + throw new SkippedTestSuiteError('The RedisArray class is required.'); } try { (new \Redis())->connect(getenv('REDIS_HOST')); } catch (\Exception $e) { - self::markTestSkipped($e->getMessage()); + throw new SkippedTestSuiteError($e->getMessage()); } } diff --git a/Tests/Store/RedisClusterStoreTest.php b/Tests/Store/RedisClusterStoreTest.php index a6f2107..9a565f5 100644 --- a/Tests/Store/RedisClusterStoreTest.php +++ b/Tests/Store/RedisClusterStoreTest.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Lock\Tests\Store; +use PHPUnit\Framework\SkippedTestSuiteError; + /** * @author Jérémy Derussé * @@ -22,10 +24,10 @@ class RedisClusterStoreTest extends AbstractRedisStoreTest public static function setUpBeforeClass(): void { if (!class_exists(\RedisCluster::class)) { - self::markTestSkipped('The RedisCluster class is required.'); + throw new SkippedTestSuiteError('The RedisCluster class is required.'); } if (!getenv('REDIS_CLUSTER_HOSTS')) { - self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.'); + throw new SkippedTestSuiteError('REDIS_CLUSTER_HOSTS env var is not defined.'); } } diff --git a/Tests/Store/RedisStoreTest.php b/Tests/Store/RedisStoreTest.php index acec9c4..0f01e26 100644 --- a/Tests/Store/RedisStoreTest.php +++ b/Tests/Store/RedisStoreTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Lock\Tests\Store; +use PHPUnit\Framework\SkippedTestSuiteError; use Symfony\Component\Lock\Exception\InvalidTtlException; use Symfony\Component\Lock\Store\RedisStore; @@ -27,7 +28,7 @@ public static function setUpBeforeClass(): void try { (new \Redis())->connect(getenv('REDIS_HOST')); } catch (\Exception $e) { - self::markTestSkipped($e->getMessage()); + throw new SkippedTestSuiteError($e->getMessage()); } }