Merge branch '4.4' into 5.2

* 4.4:
  Fix SkippedTestSuite
  [Console] Fix type annotation on InputInterface::hasArgument()
  Revert "minor #41949 [Console] fix type annotations on InputInterface (nicolas-grekas)"
  [EventDispatcher] Correct the called event listener method case
  Add missing translations for Japanese.
  Revert "bug #41952 [Console] fix handling positional arguments (nicolas-grekas)"
  [Security] Don't skip UserPasswordValidatorTest
  [DI] CS fix
  [Console] fix handling positional arguments
  [Validator] add translation for Vietnamese
  Add Bulgarian translation for the validator
This commit is contained in:
Nicolas Grekas 2021-07-04 11:27:50 +02:00
commit 5da049d9b0
34 changed files with 107 additions and 55 deletions

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\Cache\Tests\Adapter;
use PHPUnit\Framework\SkippedTestSuiteError;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\RedisAdapter;
@ -32,12 +33,12 @@ abstract class AbstractRedisAdapterTest extends AdapterTestCase
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());
}
}

View File

@ -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\CouchbaseBucketAdapter;
@ -34,7 +35,7 @@ class CouchbaseBucketAdapterTest extends AdapterTestCase
public static function setupBeforeClass(): void
{
if (!CouchbaseBucketAdapter::isSupported()) {
self::markTestSkipped('Couchbase >= 2.6.0 < 3.0.0 is required.');
throw new SkippedTestSuiteError('Couchbase >= 2.6.0 < 3.0.0 is required.');
}
self::$client = AbstractAdapter::createConnection('couchbase://'.getenv('COUCHBASE_HOST').'/cache',

View File

@ -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;
@ -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()));
}
}

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\Cache\Tests\Adapter;
use PHPUnit\Framework\SkippedTestSuiteError;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\PdoAdapter;
@ -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');

View File

@ -15,6 +15,7 @@ use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\AbstractMySQLDriver;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\Schema;
use PHPUnit\Framework\SkippedTestSuiteError;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\PdoAdapter;
@ -30,7 +31,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');

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\Cache\Tests\Adapter;
use PHPUnit\Framework\SkippedTestSuiteError;
use Symfony\Component\Cache\Adapter\RedisAdapter;
/**
@ -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_']);

View File

@ -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;
@ -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_']);

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Cache\Tests\Adapter;
use PHPUnit\Framework\SkippedTestSuiteError;
/**
* @group integration
*/
@ -20,7 +22,7 @@ class RedisArrayAdapterTest extends AbstractRedisAdapterTest
{
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_');

View File

@ -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;
@ -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]);

View File

@ -106,7 +106,7 @@ abstract class Input implements InputInterface, StreamableInputInterface
*/
public function getArgument($name)
{
if (!$this->definition->hasArgument($name)) {
if (!$this->definition->hasArgument((string) $name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
@ -118,7 +118,7 @@ abstract class Input implements InputInterface, StreamableInputInterface
*/
public function setArgument($name, $value)
{
if (!$this->definition->hasArgument($name)) {
if (!$this->definition->hasArgument((string) $name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
@ -130,7 +130,7 @@ abstract class Input implements InputInterface, StreamableInputInterface
*/
public function hasArgument($name)
{
return $this->definition->hasArgument($name);
return $this->definition->hasArgument((string) $name);
}
/**

View File

@ -83,7 +83,7 @@ interface InputInterface
/**
* Returns the argument value for a given argument name.
*
* @param string|int $name The InputArgument name or position
* @param string $name The argument name
*
* @return mixed
*
@ -94,8 +94,8 @@ interface InputInterface
/**
* Sets an argument value by name.
*
* @param string|int $name The InputArgument name or position
* @param mixed $value The argument value
* @param string $name The argument name
* @param mixed $value The argument value
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
@ -104,7 +104,7 @@ interface InputInterface
/**
* Returns true if an InputArgument object exists by name or position.
*
* @param string|int $name The InputArgument name or position
* @param string $name The InputArgument name or position
*
* @return bool true if the InputArgument object exists, false otherwise
*/

View File

@ -378,9 +378,7 @@ class Container implements ContainerInterface, ResetInterface
$this->set($id, new ServiceLocator([]));
}
if (!$this->getEnv) {
$this->getEnv = new \ReflectionMethod($this, __FUNCTION__);
$this->getEnv->setAccessible(true);
$this->getEnv = $this->getEnv->getClosure($this);
$this->getEnv = \Closure::fromCallable([$this, 'getEnv']);
}
$processors = $this->get($id);

View File

@ -98,7 +98,7 @@ class RegisterListenersPass implements CompilerPassInterface
if (!isset($event['method'])) {
$event['method'] = 'on'.preg_replace_callback([
'/(?<=\b)[a-z]/i',
'/(?<=\b|_)[a-z]/i',
'/[^a-z0-9]/i',
], function ($matches) { return strtoupper($matches[0]); }, $event['event']);
$event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']);

View File

@ -196,6 +196,7 @@ class RegisterListenersPassTest extends TestCase
$container->register('foo', \stdClass::class)->addTag('kernel.event_listener', ['event' => 'foo.bar']);
$container->register('bar', InvokableListenerService::class)->addTag('kernel.event_listener', ['event' => 'foo.bar']);
$container->register('baz', InvokableListenerService::class)->addTag('kernel.event_listener', ['event' => 'event']);
$container->register('zar', \stdClass::class)->addTag('kernel.event_listener', ['event' => 'foo.bar_zar']);
$container->register('event_dispatcher', \stdClass::class);
$registerListenersPass = new RegisterListenersPass();
@ -227,6 +228,14 @@ class RegisterListenersPassTest extends TestCase
0,
],
],
[
'addListener',
[
'foo.bar_zar',
[new ServiceClosureArgument(new Reference('zar')), 'onFooBarZar'],
0,
],
],
];
$this->assertEquals($expectedCalls, $definition->getMethodCalls());
}

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\HttpClient\Tests;
use PHPUnit\Framework\SkippedTestSuiteError;
use Symfony\Component\HttpClient\Exception\ClientException;
use Symfony\Component\HttpClient\Exception\TransportException;
use Symfony\Component\HttpClient\Internal\ClientState;
@ -295,11 +296,11 @@ abstract class HttpClientTestCase extends BaseHttpClientTestCase
}
if ('\\' === \DIRECTORY_SEPARATOR) {
self::markTestSkipped('Testing with the "vulcain" is not supported on Windows.');
throw new SkippedTestSuiteError('Testing with the "vulcain" is not supported on Windows.');
}
if (['application/json'] !== $client->request('GET', 'http://127.0.0.1:8057/json')->getHeaders()['content-type']) {
self::markTestSkipped('symfony/http-client-contracts >= 2.0.1 required');
throw new SkippedTestSuiteError('symfony/http-client-contracts >= 2.0.1 required');
}
$process = new Process(['vulcain'], null, [
@ -316,14 +317,14 @@ abstract class HttpClientTestCase extends BaseHttpClientTestCase
if (!$process->isRunning()) {
if ('\\' !== \DIRECTORY_SEPARATOR && 127 === $process->getExitCode()) {
self::markTestSkipped('vulcain binary is missing');
throw new SkippedTestSuiteError('vulcain binary is missing');
}
if ('\\' !== \DIRECTORY_SEPARATOR && 126 === $process->getExitCode()) {
self::markTestSkipped('vulcain binary is not executable');
throw new SkippedTestSuiteError('vulcain binary is not executable');
}
self::markTestSkipped((new ProcessFailedException($process))->getMessage());
throw new SkippedTestSuiteError((new ProcessFailedException($process))->getMessage());
}
self::$vulcainStarted = true;

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\HttpFoundation\Tests;
use PHPUnit\Framework\SkippedTestSuiteError;
use PHPUnit\Framework\TestCase;
class ResponseFunctionalTest extends TestCase
@ -24,7 +25,7 @@ class ResponseFunctionalTest extends TestCase
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);
}

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
use PHPUnit\Framework\SkippedTestSuiteError;
use PHPUnit\Framework\TestCase;
class AbstractSessionHandlerTest extends TestCase
@ -24,7 +25,7 @@ class AbstractSessionHandlerTest extends TestCase
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);
}

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
use PHPUnit\Framework\SkippedTestSuiteError;
/**
* @group integration
*/
@ -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.');
}
}

View File

@ -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 @@ class MemcachedStoreTest extends AbstractStoreTest
$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');
}
}

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Lock\Tests\Store;
use MongoDB\Client;
use MongoDB\Driver\Exception\ConnectionTimeoutException;
use PHPUnit\Framework\SkippedTestSuiteError;
use Symfony\Component\Lock\Exception\InvalidArgumentException;
use Symfony\Component\Lock\Key;
use Symfony\Component\Lock\PersistingStoreInterface;
@ -31,14 +32,14 @@ class MongoDbStoreTest extends AbstractStoreTest
public static function setupBeforeClass(): void
{
if (!class_exists(\MongoDB\Client::class)) {
self::markTestSkipped('The mongodb/mongodb package is required.');
throw new SkippedTestSuiteError('The mongodb/mongodb package is required.');
}
$client = self::getMongoClient();
try {
$client->listDatabases();
} catch (ConnectionTimeoutException $e) {
self::markTestSkipped('MongoDB server not found.');
throw new SkippedTestSuiteError('MongoDB server not found.');
}
}

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Lock\Tests\Store;
use PHPUnit\Framework\SkippedTestSuiteError;
/**
* @author Jérémy Derussé <jeremy@derusse.com>
* @group integration
@ -23,7 +25,7 @@ class PredisStoreTest extends AbstractRedisStoreTest
try {
$redis->connect();
} catch (\Exception $e) {
self::markTestSkipped($e->getMessage());
throw new SkippedTestSuiteError($e->getMessage());
}
}

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Lock\Tests\Store;
use PHPUnit\Framework\SkippedTestSuiteError;
/**
* @author Jérémy Derussé <jeremy@derusse.com>
*
@ -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());
}
}

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Lock\Tests\Store;
use PHPUnit\Framework\SkippedTestSuiteError;
/**
* @author Jérémy Derussé <jeremy@derusse.com>
*
@ -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.');
}
}

View File

@ -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;
@ -29,7 +30,7 @@ class RedisStoreTest extends AbstractRedisStoreTest
try {
(new \Redis())->connect(getenv('REDIS_HOST'));
} catch (\Exception $e) {
self::markTestSkipped($e->getMessage());
throw new SkippedTestSuiteError($e->getMessage());
}
}

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\Messenger\Bridge\Redis\Tests\Transport;
use PHPUnit\Framework\SkippedTestSuiteError;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
use Symfony\Component\Messenger\Bridge\Redis\Transport\Connection;
@ -31,12 +32,12 @@ class ConnectionTest extends TestCase
$redis->get();
} catch (TransportException $e) {
if (0 === strpos($e->getMessage(), 'ERR unknown command \'X')) {
self::markTestSkipped('Redis server >= 5 is required');
throw new SkippedTestSuiteError('Redis server >= 5 is required');
}
throw $e;
} catch (\RedisException $e) {
self::markTestSkipped($e->getMessage());
throw new SkippedTestSuiteError($e->getMessage());
}
}

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\Security\Core\Tests\Validator\Constraints;
use Foo\Bar\User;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
@ -25,7 +24,7 @@ use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
abstract class UserPasswordValidatorTest extends ConstraintValidatorTestCase
class UserPasswordValidatorTest extends ConstraintValidatorTestCase
{
private const PASSWORD = 's3Cr3t';
private const SALT = '^S4lt$';
@ -126,7 +125,7 @@ abstract class UserPasswordValidatorTest extends ConstraintValidatorTestCase
public function testUserIsNotValid()
{
$this->expectException(ConstraintDefinitionException::class);
$user = $this->createMock(User::class);
$user = new \stdClass();
$this->tokenStorage = $this->createTokenStorage($user);
$this->validator = $this->createValidator();

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\Security\Http\Tests\RememberMe;
use PHPUnit\Framework\SkippedTestSuiteError;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
@ -34,7 +35,7 @@ class PersistentTokenBasedRememberMeServicesTest extends TestCase
try {
random_bytes(1);
} catch (\Exception $e) {
self::markTestSkipped($e->getMessage());
throw new SkippedTestSuiteError($e->getMessage());
}
}

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Semaphore\Tests\Store;
use PHPUnit\Framework\SkippedTestSuiteError;
/**
* @author Jérémy Derussé <jeremy@derusse.com>
*/
@ -22,7 +24,7 @@ class PredisStoreTest extends AbstractRedisStoreTest
try {
$redis->connect();
} catch (\Exception $e) {
self::markTestSkipped($e->getMessage());
throw new SkippedTestSuiteError($e->getMessage());
}
}

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Semaphore\Tests\Store;
use PHPUnit\Framework\SkippedTestSuiteError;
/**
* @author Jérémy Derussé <jeremy@derusse.com>
*
@ -21,12 +23,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());
}
}

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Semaphore\Tests\Store;
use PHPUnit\Framework\SkippedTestSuiteError;
/**
* @author Jérémy Derussé <jeremy@derusse.com>
*
@ -21,10 +23,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.');
}
}

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Semaphore\Tests\Store;
use PHPUnit\Framework\SkippedTestSuiteError;
/**
* @author Jérémy Derussé <jeremy@derusse.com>
*
@ -28,7 +30,7 @@ class RedisStoreTest extends AbstractRedisStoreTest
try {
(new \Redis())->connect(getenv('REDIS_HOST'));
} catch (\Exception $e) {
self::markTestSkipped($e->getMessage());
throw new SkippedTestSuiteError($e->getMessage());
}
}

View File

@ -386,6 +386,10 @@
<source>This value is not a valid International Securities Identification Number (ISIN).</source>
<target>Стойността не е валиден Международен идентификационен номер на ценни книжа (ISIN).</target>
</trans-unit>
<trans-unit id="100">
<source>This value should be a valid expression.</source>
<target>Стойността трябва да бъде валиден израз.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -386,6 +386,10 @@
<source>This value is not a valid International Securities Identification Number (ISIN).</source>
<target>この値は有効な国際証券識別番号ISINではありません。</target>
</trans-unit>
<trans-unit id="100">
<source>This value should be a valid expression.</source>
<target>式でなければなりません。</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -386,6 +386,10 @@
<source>This value is not a valid International Securities Identification Number (ISIN).</source>
<target>Giá trị này không phải là mã số chứng khoán quốc tế (ISIN) hợp lệ.</target>
</trans-unit>
<trans-unit id="100">
<source>This value should be a valid expression.</source>
<target>Giá trị này phải là một biểu thức hợp lệ.</target>
</trans-unit>
</body>
</file>
</xliff>