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

Fix SkippedTestSuite #41384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Cache\Tests\Adapter;

use PHPUnit\Framework\SkippedTestSuiteError;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\RedisAdapter;

Expand All @@ -32,12 +33,12 @@ public function createCachePool(int $defaultLifetime = 0, string $testMethod = n
public static function setUpBeforeClass(): void
{
if (!\extension_loaded('redis')) {
self::markTestSkipped('Extension redis required.');
throw new SkippedTestSuiteError('Extension redis required.');
}
try {
(new \Redis())->connect(getenv('REDIS_HOST'));
} catch (\Exception $e) {
self::markTestSkipped($e->getMessage());
throw new SkippedTestSuiteError($e->getMessage());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Cache\Tests\Adapter;

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

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

Expand Down
3 changes: 2 additions & 1 deletion 3 src/Symfony/Component/Cache/Tests/Adapter/PdoAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Cache\Tests\Adapter;

use PHPUnit\Framework\SkippedTestSuiteError;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\PdoAdapter;

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

self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\Cache\Tests\Adapter;

use Doctrine\DBAL\DriverManager;
use PHPUnit\Framework\SkippedTestSuiteError;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\PdoAdapter;

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

self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Cache\Tests\Adapter;

use PHPUnit\Framework\SkippedTestSuiteError;
use Symfony\Component\Cache\Adapter\RedisAdapter;

/**
Expand All @@ -21,7 +22,7 @@ class PredisRedisClusterAdapterTest extends AbstractRedisAdapterTest
public static function setUpBeforeClass(): void
{
if (!$hosts = 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.');
}

self::$redis = RedisAdapter::createConnection('redis:?host['.str_replace(' ', ']&host[', $hosts).']', ['class' => \Predis\Client::class, 'redis_cluster' => true, 'prefix' => 'prefix_']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Cache\Tests\Adapter;

use PHPUnit\Framework\SkippedTestSuiteError;
use Symfony\Component\Cache\Adapter\AbstractAdapter;
use Symfony\Component\Cache\Adapter\RedisAdapter;
use Symfony\Component\Cache\Exception\InvalidArgumentException;
Expand All @@ -23,13 +24,13 @@ class RedisAdapterSentinelTest extends AbstractRedisAdapterTest
public static function setUpBeforeClass(): void
{
if (!class_exists(\Predis\Client::class)) {
self::markTestSkipped('The Predis\Client class is required.');
throw new SkippedTestSuiteError('The Predis\Client class is required.');
}
if (!$hosts = getenv('REDIS_SENTINEL_HOSTS')) {
self::markTestSkipped('REDIS_SENTINEL_HOSTS env var is not defined.');
throw new SkippedTestSuiteError('REDIS_SENTINEL_HOSTS env var is not defined.');
}
if (!$service = getenv('REDIS_SENTINEL_SERVICE')) {
self::markTestSkipped('REDIS_SENTINEL_SERVICE env var is not defined.');
throw new SkippedTestSuiteError('REDIS_SENTINEL_SERVICE env var is not defined.');
}

self::$redis = AbstractAdapter::createConnection('redis:?host['.str_replace(' ', ']&host[', $hosts).']', ['redis_sentinel' => $service, 'prefix' => 'prefix_']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\Cache\Tests\Adapter;

use PHPUnit\Framework\SkippedTestSuiteError;

/**
* @group integration
*/
Expand All @@ -20,7 +22,7 @@ public static function setUpBeforeClass(): void
{
parent::setupBeforeClass();
if (!class_exists(\RedisArray::class)) {
self::markTestSkipped('The RedisArray class is required.');
throw new SkippedTestSuiteError('The RedisArray class is required.');
}
self::$redis = new \RedisArray([getenv('REDIS_HOST')], ['lazy_connect' => true]);
self::$redis->setOption(\Redis::OPT_PREFIX, 'prefix_');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Cache\Tests\Adapter;

use PHPUnit\Framework\SkippedTestSuiteError;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\AbstractAdapter;
use Symfony\Component\Cache\Adapter\RedisAdapter;
Expand All @@ -25,10 +26,10 @@ class RedisClusterAdapterTest extends AbstractRedisAdapterTest
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 (!$hosts = 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.');
}

self::$redis = AbstractAdapter::createConnection('redis:?host['.str_replace(' ', ']&host[', $hosts).']', ['lazy' => true, 'redis_cluster' => true]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Cache\Tests\Simple;

use PHPUnit\Framework\SkippedTestSuiteError;
use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Cache\Simple\RedisCache;

Expand All @@ -35,12 +36,12 @@ public function createSimpleCache(int $defaultLifetime = 0): CacheInterface
public static function setUpBeforeClass(): void
{
if (!\extension_loaded('redis')) {
self::markTestSkipped('Extension redis required.');
throw new SkippedTestSuiteError('Extension redis required.');
}
try {
(new \Redis())->connect(getenv('REDIS_HOST'));
} catch (\Exception $e) {
self::markTestSkipped($e->getMessage());
throw new SkippedTestSuiteError($e->getMessage());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Cache\Tests\Simple;

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

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

Expand Down
3 changes: 2 additions & 1 deletion 3 src/Symfony/Component/Cache/Tests/Simple/PdoCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Cache\Tests\Simple;

use PHPUnit\Framework\SkippedTestSuiteError;
use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Cache\Simple\PdoCache;
use Symfony\Component\Cache\Tests\Adapter\PdoPruneableTrait;
Expand All @@ -28,7 +29,7 @@ class PdoCacheTest extends CacheTestCase
public static function setUpBeforeClass(): void
{
if (!\extension_loaded('pdo_sqlite')) {
self::markTestSkipped('Extension pdo_sqlite required.');
throw new SkippedTestSuiteError('Extension pdo_sqlite required.');
}

self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\Cache\Tests\Simple;

use Doctrine\DBAL\DriverManager;
use PHPUnit\Framework\SkippedTestSuiteError;
use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Cache\Simple\PdoCache;
use Symfony\Component\Cache\Tests\Adapter\PdoPruneableTrait;
Expand All @@ -29,7 +30,7 @@ class PdoDbalCacheTest extends CacheTestCase
public static function setUpBeforeClass(): void
{
if (!\extension_loaded('pdo_sqlite')) {
self::markTestSkipped('Extension pdo_sqlite required.');
throw new SkippedTestSuiteError('Extension pdo_sqlite required.');
}

self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\Cache\Tests\Simple;

use PHPUnit\Framework\SkippedTestSuiteError;

/**
* @group legacy
* @group integration
Expand All @@ -21,7 +23,7 @@ public static function setUpBeforeClass(): void
{
parent::setupBeforeClass();
if (!class_exists(\RedisArray::class)) {
self::markTestSkipped('The RedisArray class is required.');
throw new SkippedTestSuiteError('The RedisArray class is required.');
}
self::$redis = new \RedisArray([getenv('REDIS_HOST')], ['lazy_connect' => true]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\Cache\Tests\Simple;

use PHPUnit\Framework\SkippedTestSuiteError;

/**
* @group legacy
* @group integration
Expand All @@ -20,10 +22,10 @@ class RedisClusterCacheTest extends AbstractRedisCacheTest
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 (!$hosts = 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.');
}

self::$redis = new \RedisCluster(null, explode(' ', $hosts));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\HttpFoundation\Tests;

use PHPUnit\Framework\SkippedTestSuiteError;
use PHPUnit\Framework\TestCase;

class ResponseFunctionalTest extends TestCase
Expand All @@ -24,7 +25,7 @@ public static function setUpBeforeClass(): void
2 => ['file', '/dev/null', 'w'],
];
if (!self::$server = @proc_open('exec '.\PHP_BINARY.' -S localhost:8054', $spec, $pipes, __DIR__.'/Fixtures/response-functional')) {
self::markTestSkipped('PHP server unable to start.');
throw new SkippedTestSuiteError('PHP server unable to start.');
}
sleep(1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

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

use PHPUnit\Framework\SkippedTestSuiteError;
use PHPUnit\Framework\TestCase;

class AbstractSessionHandlerTest extends TestCase
Expand All @@ -24,7 +25,7 @@ public static function setUpBeforeClass(): void
2 => ['file', '/dev/null', 'w'],
];
if (!self::$server = @proc_open('exec '.\PHP_BINARY.' -S localhost:8053', $spec, $pipes, __DIR__.'/Fixtures')) {
self::markTestSkipped('PHP server unable to start.');
throw new SkippedTestSuiteError('PHP server unable to start.');
}
sleep(1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

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

use PHPUnit\Framework\SkippedTestSuiteError;

/**
* @group integration
*/
Expand All @@ -19,11 +21,11 @@ class RedisClusterSessionHandlerTest extends AbstractRedisSessionHandlerTestCase
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 (!$hosts = 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.');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\Lock\Tests\Store;

use PHPUnit\Framework\SkippedTestSuiteError;

/**
* @author Jérémy Derussé <jeremy@derusse.com>
* @group integration
Expand All @@ -23,7 +25,7 @@ public static function setUpBeforeClass(): void
try {
$redis->connect();
} catch (\Exception $e) {
self::markTestSkipped($e->getMessage());
throw new SkippedTestSuiteError($e->getMessage());
}
}

Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.