Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7820f8d

Browse filesBrowse files
committed
bug #41384 Fix SkippedTestSuite (jderusse)
This PR was merged into the 4.4 branch. Discussion ---------- Fix SkippedTestSuite | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Throwing a TestSkipped in a `setUpBeforeClass` si handled by PHP unit as a standard exception, leading to a generic exception `Test skipped because of an error in hook method` (see https://github.com/symfony/symfony/pull/41380/checks?check_run_id=2645369759#step:14:165) However phpunit is able to catch `SkippedTestSuiteError` in such situation.(https://github.com/sebastianbergmann/phpunit/blob/master/src/Framework/TestSuite.php#L438-L448) This PR replaces `self::markTestSkipped` by `throw new SkippedTestSuiteError` (we don't have static method helper for this exception) in our `setUpBeforeClass` methods. Commits ------- 6f2aa6d Fix SkippedTestSuite
2 parents 2abf5a4 + 6f2aa6d commit 7820f8d
Copy full SHA for 7820f8d

24 files changed

+67
-36
lines changed

‎src/Symfony/Component/Cache/Tests/Adapter/AbstractRedisAdapterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Adapter/AbstractRedisAdapterTest.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use Psr\Cache\CacheItemPoolInterface;
1516
use Symfony\Component\Cache\Adapter\RedisAdapter;
1617

@@ -32,12 +33,12 @@ public function createCachePool(int $defaultLifetime = 0, string $testMethod = n
3233
public static function setUpBeforeClass(): void
3334
{
3435
if (!\extension_loaded('redis')) {
35-
self::markTestSkipped('Extension redis required.');
36+
throw new SkippedTestSuiteError('Extension redis required.');
3637
}
3738
try {
3839
(new \Redis())->connect(getenv('REDIS_HOST'));
3940
} catch (\Exception $e) {
40-
self::markTestSkipped($e->getMessage());
41+
throw new SkippedTestSuiteError($e->getMessage());
4142
}
4243
}
4344

‎src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use Psr\Cache\CacheItemPoolInterface;
1516
use Symfony\Component\Cache\Adapter\AbstractAdapter;
1617
use Symfony\Component\Cache\Adapter\MemcachedAdapter;
@@ -32,14 +33,14 @@ class MemcachedAdapterTest extends AdapterTestCase
3233
public static function setUpBeforeClass(): void
3334
{
3435
if (!MemcachedAdapter::isSupported()) {
35-
self::markTestSkipped('Extension memcached >=2.2.0 required.');
36+
throw new SkippedTestSuiteError('Extension memcached >=2.2.0 required.');
3637
}
3738
self::$client = AbstractAdapter::createConnection('memcached://'.getenv('MEMCACHED_HOST'), ['binary_protocol' => false]);
3839
self::$client->get('foo');
3940
$code = self::$client->getResultCode();
4041

4142
if (\Memcached::RES_SUCCESS !== $code && \Memcached::RES_NOTFOUND !== $code) {
42-
self::markTestSkipped('Memcached error: '.strtolower(self::$client->getResultMessage()));
43+
throw new SkippedTestSuiteError('Memcached error: '.strtolower(self::$client->getResultMessage()));
4344
}
4445
}
4546

‎src/Symfony/Component/Cache/Tests/Adapter/PdoAdapterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Adapter/PdoAdapterTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use Psr\Cache\CacheItemPoolInterface;
1516
use Symfony\Component\Cache\Adapter\PdoAdapter;
1617

@@ -26,7 +27,7 @@ class PdoAdapterTest extends AdapterTestCase
2627
public static function setUpBeforeClass(): void
2728
{
2829
if (!\extension_loaded('pdo_sqlite')) {
29-
self::markTestSkipped('Extension pdo_sqlite required.');
30+
throw new SkippedTestSuiteError('Extension pdo_sqlite required.');
3031
}
3132

3233
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');

‎src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

1414
use Doctrine\DBAL\DriverManager;
15+
use PHPUnit\Framework\SkippedTestSuiteError;
1516
use Psr\Cache\CacheItemPoolInterface;
1617
use Symfony\Component\Cache\Adapter\PdoAdapter;
1718

@@ -27,7 +28,7 @@ class PdoDbalAdapterTest extends AdapterTestCase
2728
public static function setUpBeforeClass(): void
2829
{
2930
if (!\extension_loaded('pdo_sqlite')) {
30-
self::markTestSkipped('Extension pdo_sqlite required.');
31+
throw new SkippedTestSuiteError('Extension pdo_sqlite required.');
3132
}
3233

3334
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');

‎src/Symfony/Component/Cache/Tests/Adapter/PredisRedisClusterAdapterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Adapter/PredisRedisClusterAdapterTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use Symfony\Component\Cache\Adapter\RedisAdapter;
1516

1617
/**
@@ -21,7 +22,7 @@ class PredisRedisClusterAdapterTest extends AbstractRedisAdapterTest
2122
public static function setUpBeforeClass(): void
2223
{
2324
if (!$hosts = getenv('REDIS_CLUSTER_HOSTS')) {
24-
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
25+
throw new SkippedTestSuiteError('REDIS_CLUSTER_HOSTS env var is not defined.');
2526
}
2627

2728
self::$redis = RedisAdapter::createConnection('redis:?host['.str_replace(' ', ']&host[', $hosts).']', ['class' => \Predis\Client::class, 'redis_cluster' => true, 'prefix' => 'prefix_']);

‎src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterSentinelTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterSentinelTest.php
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use Symfony\Component\Cache\Adapter\AbstractAdapter;
1516
use Symfony\Component\Cache\Adapter\RedisAdapter;
1617
use Symfony\Component\Cache\Exception\InvalidArgumentException;
@@ -23,13 +24,13 @@ class RedisAdapterSentinelTest extends AbstractRedisAdapterTest
2324
public static function setUpBeforeClass(): void
2425
{
2526
if (!class_exists(\Predis\Client::class)) {
26-
self::markTestSkipped('The Predis\Client class is required.');
27+
throw new SkippedTestSuiteError('The Predis\Client class is required.');
2728
}
2829
if (!$hosts = getenv('REDIS_SENTINEL_HOSTS')) {
29-
self::markTestSkipped('REDIS_SENTINEL_HOSTS env var is not defined.');
30+
throw new SkippedTestSuiteError('REDIS_SENTINEL_HOSTS env var is not defined.');
3031
}
3132
if (!$service = getenv('REDIS_SENTINEL_SERVICE')) {
32-
self::markTestSkipped('REDIS_SENTINEL_SERVICE env var is not defined.');
33+
throw new SkippedTestSuiteError('REDIS_SENTINEL_SERVICE env var is not defined.');
3334
}
3435

3536
self::$redis = AbstractAdapter::createConnection('redis:?host['.str_replace(' ', ']&host[', $hosts).']', ['redis_sentinel' => $service, 'prefix' => 'prefix_']);

‎src/Symfony/Component/Cache/Tests/Adapter/RedisArrayAdapterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Adapter/RedisArrayAdapterTest.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
15+
1416
/**
1517
* @group integration
1618
*/
@@ -20,7 +22,7 @@ public static function setUpBeforeClass(): void
2022
{
2123
parent::setupBeforeClass();
2224
if (!class_exists(\RedisArray::class)) {
23-
self::markTestSkipped('The RedisArray class is required.');
25+
throw new SkippedTestSuiteError('The RedisArray class is required.');
2426
}
2527
self::$redis = new \RedisArray([getenv('REDIS_HOST')], ['lazy_connect' => true]);
2628
self::$redis->setOption(\Redis::OPT_PREFIX, 'prefix_');

‎src/Symfony/Component/Cache/Tests/Adapter/RedisClusterAdapterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Adapter/RedisClusterAdapterTest.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use Psr\Cache\CacheItemPoolInterface;
1516
use Symfony\Component\Cache\Adapter\AbstractAdapter;
1617
use Symfony\Component\Cache\Adapter\RedisAdapter;
@@ -25,10 +26,10 @@ class RedisClusterAdapterTest extends AbstractRedisAdapterTest
2526
public static function setUpBeforeClass(): void
2627
{
2728
if (!class_exists(\RedisCluster::class)) {
28-
self::markTestSkipped('The RedisCluster class is required.');
29+
throw new SkippedTestSuiteError('The RedisCluster class is required.');
2930
}
3031
if (!$hosts = getenv('REDIS_CLUSTER_HOSTS')) {
31-
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
32+
throw new SkippedTestSuiteError('REDIS_CLUSTER_HOSTS env var is not defined.');
3233
}
3334

3435
self::$redis = AbstractAdapter::createConnection('redis:?host['.str_replace(' ', ']&host[', $hosts).']', ['lazy' => true, 'redis_cluster' => true]);

‎src/Symfony/Component/Cache/Tests/Simple/AbstractRedisCacheTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Simple/AbstractRedisCacheTest.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Simple;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use Psr\SimpleCache\CacheInterface;
1516
use Symfony\Component\Cache\Simple\RedisCache;
1617

@@ -35,12 +36,12 @@ public function createSimpleCache(int $defaultLifetime = 0): CacheInterface
3536
public static function setUpBeforeClass(): void
3637
{
3738
if (!\extension_loaded('redis')) {
38-
self::markTestSkipped('Extension redis required.');
39+
throw new SkippedTestSuiteError('Extension redis required.');
3940
}
4041
try {
4142
(new \Redis())->connect(getenv('REDIS_HOST'));
4243
} catch (\Exception $e) {
43-
self::markTestSkipped($e->getMessage());
44+
throw new SkippedTestSuiteError($e->getMessage());
4445
}
4546
}
4647

‎src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTest.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Simple;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use Psr\SimpleCache\CacheInterface;
1516
use Symfony\Component\Cache\Adapter\AbstractAdapter;
1617
use Symfony\Component\Cache\Exception\CacheException;
@@ -33,14 +34,14 @@ class MemcachedCacheTest extends CacheTestCase
3334
public static function setUpBeforeClass(): void
3435
{
3536
if (!MemcachedCache::isSupported()) {
36-
self::markTestSkipped('Extension memcached >=2.2.0 required.');
37+
throw new SkippedTestSuiteError('Extension memcached >=2.2.0 required.');
3738
}
3839
self::$client = AbstractAdapter::createConnection('memcached://'.getenv('MEMCACHED_HOST'));
3940
self::$client->get('foo');
4041
$code = self::$client->getResultCode();
4142

4243
if (\Memcached::RES_SUCCESS !== $code && \Memcached::RES_NOTFOUND !== $code) {
43-
self::markTestSkipped('Memcached error: '.strtolower(self::$client->getResultMessage()));
44+
throw new SkippedTestSuiteError('Memcached error: '.strtolower(self::$client->getResultMessage()));
4445
}
4546
}
4647

‎src/Symfony/Component/Cache/Tests/Simple/PdoCacheTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Simple/PdoCacheTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Simple;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use Psr\SimpleCache\CacheInterface;
1516
use Symfony\Component\Cache\Simple\PdoCache;
1617
use Symfony\Component\Cache\Tests\Adapter\PdoPruneableTrait;
@@ -28,7 +29,7 @@ class PdoCacheTest extends CacheTestCase
2829
public static function setUpBeforeClass(): void
2930
{
3031
if (!\extension_loaded('pdo_sqlite')) {
31-
self::markTestSkipped('Extension pdo_sqlite required.');
32+
throw new SkippedTestSuiteError('Extension pdo_sqlite required.');
3233
}
3334

3435
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');

‎src/Symfony/Component/Cache/Tests/Simple/PdoDbalCacheTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Simple/PdoDbalCacheTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Cache\Tests\Simple;
1313

1414
use Doctrine\DBAL\DriverManager;
15+
use PHPUnit\Framework\SkippedTestSuiteError;
1516
use Psr\SimpleCache\CacheInterface;
1617
use Symfony\Component\Cache\Simple\PdoCache;
1718
use Symfony\Component\Cache\Tests\Adapter\PdoPruneableTrait;
@@ -29,7 +30,7 @@ class PdoDbalCacheTest extends CacheTestCase
2930
public static function setUpBeforeClass(): void
3031
{
3132
if (!\extension_loaded('pdo_sqlite')) {
32-
self::markTestSkipped('Extension pdo_sqlite required.');
33+
throw new SkippedTestSuiteError('Extension pdo_sqlite required.');
3334
}
3435

3536
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');

‎src/Symfony/Component/Cache/Tests/Simple/RedisArrayCacheTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Simple/RedisArrayCacheTest.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Simple;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
15+
1416
/**
1517
* @group legacy
1618
* @group integration
@@ -21,7 +23,7 @@ public static function setUpBeforeClass(): void
2123
{
2224
parent::setupBeforeClass();
2325
if (!class_exists(\RedisArray::class)) {
24-
self::markTestSkipped('The RedisArray class is required.');
26+
throw new SkippedTestSuiteError('The RedisArray class is required.');
2527
}
2628
self::$redis = new \RedisArray([getenv('REDIS_HOST')], ['lazy_connect' => true]);
2729
}

‎src/Symfony/Component/Cache/Tests/Simple/RedisClusterCacheTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Simple/RedisClusterCacheTest.php
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Simple;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
15+
1416
/**
1517
* @group legacy
1618
* @group integration
@@ -20,10 +22,10 @@ class RedisClusterCacheTest extends AbstractRedisCacheTest
2022
public static function setUpBeforeClass(): void
2123
{
2224
if (!class_exists(\RedisCluster::class)) {
23-
self::markTestSkipped('The RedisCluster class is required.');
25+
throw new SkippedTestSuiteError('The RedisCluster class is required.');
2426
}
2527
if (!$hosts = getenv('REDIS_CLUSTER_HOSTS')) {
26-
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
28+
throw new SkippedTestSuiteError('REDIS_CLUSTER_HOSTS env var is not defined.');
2729
}
2830

2931
self::$redis = new \RedisCluster(null, explode(' ', $hosts));

‎src/Symfony/Component/HttpFoundation/Tests/ResponseFunctionalTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/ResponseFunctionalTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\HttpFoundation\Tests;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use PHPUnit\Framework\TestCase;
1516

1617
class ResponseFunctionalTest extends TestCase
@@ -24,7 +25,7 @@ public static function setUpBeforeClass(): void
2425
2 => ['file', '/dev/null', 'w'],
2526
];
2627
if (!self::$server = @proc_open('exec '.\PHP_BINARY.' -S localhost:8054', $spec, $pipes, __DIR__.'/Fixtures/response-functional')) {
27-
self::markTestSkipped('PHP server unable to start.');
28+
throw new SkippedTestSuiteError('PHP server unable to start.');
2829
}
2930
sleep(1);
3031
}

‎src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
1415
use PHPUnit\Framework\TestCase;
1516

1617
class AbstractSessionHandlerTest extends TestCase
@@ -24,7 +25,7 @@ public static function setUpBeforeClass(): void
2425
2 => ['file', '/dev/null', 'w'],
2526
];
2627
if (!self::$server = @proc_open('exec '.\PHP_BINARY.' -S localhost:8053', $spec, $pipes, __DIR__.'/Fixtures')) {
27-
self::markTestSkipped('PHP server unable to start.');
28+
throw new SkippedTestSuiteError('PHP server unable to start.');
2829
}
2930
sleep(1);
3031
}

‎src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/RedisClusterSessionHandlerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/RedisClusterSessionHandlerTest.php
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
1313

14+
use PHPUnit\Framework\SkippedTestSuiteError;
15+
1416
/**
1517
* @group integration
1618
*/
@@ -19,11 +21,11 @@ class RedisClusterSessionHandlerTest extends AbstractRedisSessionHandlerTestCase
1921
public static function setUpBeforeClass(): void
2022
{
2123
if (!class_exists(\RedisCluster::class)) {
22-
self::markTestSkipped('The RedisCluster class is required.');
24+
throw new SkippedTestSuiteError('The RedisCluster class is required.');
2325
}
2426

2527
if (!$hosts = getenv('REDIS_CLUSTER_HOSTS')) {
26-
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
28+
throw new SkippedTestSuiteError('REDIS_CLUSTER_HOSTS env var is not defined.');
2729
}
2830
}
2931

‎src/Symfony/Component/Lock/Tests/Store/MemcachedStoreTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Lock/Tests/Store/MemcachedStoreTest.php
+2-1Lines 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

‎src/Symfony/Component/Lock/Tests/Store/PredisStoreTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Lock/Tests/Store/PredisStoreTest.php
+3-1Lines 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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.