Skip to content

Commit 465ab16

Browse files
Merge branch '5.0'
* 5.0: (26 commits) [Filesystem] Handle paths on different drives [WebProfiler] Do not add src-elem CSP directives if they do not exist [Yaml] fix parse error when unindented collections contain a comment Execute docker dependent tests with github actions Update exception.html.php [3.4][Inflector] Improve testSingularize() argument name [Inflector] Fix testPluralize() arguments names [PhpUnitBridge] fix PHP 5.3 compat again Skip validation when email is an empty object fix sr_Latn translation [Validator] fix lazy property usage. Fix annotation [Debug][ErrorHandler] cleanup phpunit.xml.dist files [Translation] Fix for translation:update command updating ICU messages [PhpUnitBridge] fix compat with PHP 5.3 bumped Symfony version to 5.0.9 updated VERSION for 5.0.8 updated CHANGELOG for 5.0.8 bumped Symfony version to 4.4.9 updated VERSION for 4.4.8 ...
2 parents 1e72962 + da16852 commit 465ab16

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Command/TranslationUpdateCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,14 @@ private function filterCatalogue(MessageCatalogue $catalogue, string $domain): M
318318
{
319319
$filteredCatalogue = new MessageCatalogue($catalogue->getLocale());
320320

321-
if ($messages = $catalogue->all($domain)) {
321+
// extract intl-icu messages only
322+
$intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX;
323+
if ($intlMessages = $catalogue->all($intlDomain)) {
324+
$filteredCatalogue->add($intlMessages, $intlDomain);
325+
}
326+
327+
// extract all messages and subtract intl-icu messages
328+
if ($messages = array_diff($catalogue->all($domain), $intlMessages)) {
322329
$filteredCatalogue->add($messages, $domain);
323330
}
324331
foreach ($catalogue->getResources() as $resource) {

Tests/Functional/CachePoolsTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ public function testCachePools()
2626

2727
/**
2828
* @requires extension redis
29+
* @group integration
2930
*/
3031
public function testRedisCachePools()
3132
{
33+
$this->skipIfRedisUnavailable();
34+
3235
try {
3336
$this->doTestCachePools(['root_config' => 'redis_config.yml', 'environment' => 'redis_cache'], RedisAdapter::class);
3437
} catch (\PHPUnit\Framework\Error\Warning $e) {
@@ -51,9 +54,12 @@ public function testRedisCachePools()
5154

5255
/**
5356
* @requires extension redis
57+
* @group integration
5458
*/
5559
public function testRedisCustomCachePools()
5660
{
61+
$this->skipIfRedisUnavailable();
62+
5763
try {
5864
$this->doTestCachePools(['root_config' => 'redis_custom_config.yml', 'environment' => 'custom_redis_cache'], RedisAdapter::class);
5965
} catch (\PHPUnit\Framework\Error\Warning $e) {
@@ -121,4 +127,13 @@ protected static function createKernel(array $options = []): KernelInterface
121127
{
122128
return parent::createKernel(['test_case' => 'CachePools'] + $options);
123129
}
130+
131+
private function skipIfRedisUnavailable()
132+
{
133+
try {
134+
(new \Redis())->connect(getenv('REDIS_HOST'));
135+
} catch (\Exception $e) {
136+
self::markTestSkipped($e->getMessage());
137+
}
138+
}
124139
}

0 commit comments

Comments
 (0)