Skip to content
Permalink
Browse files

Merge branch '3.4' into 4.3

* 3.4:
  cleanups
  Disable PHPUnit result cache on the CI
  [Translation] Highlight invalid translation status
  • Loading branch information...
nicolas-grekas committed Aug 10, 2019
2 parents 6070daa + 7fb7f59 commit 9d9f5582b223d7ed3538f00f6d9c638e763a17f7
@@ -12,6 +12,7 @@ init:
- SET SYMFONY_DEPRECATIONS_HELPER=strict
- SET "SYMFONY_REQUIRE=>=4.2"
- SET ANSICON=121x90 (121x90)
- SET SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f

install:
@@ -21,6 +21,7 @@ env:
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/shims/php
- MESSENGER_AMQP_DSN=amqp://localhost/%2f/messages
- MESSENGER_REDIS_DSN=redis://127.0.0.1:7001/messages
- SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1

matrix:
include:
@@ -166,6 +166,14 @@ class SymfonyBlacklistPhpunit {}
global $argv, $argc;
$argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
$argc = isset($_SERVER['argc']) ? $_SERVER['argc'] : 0;
if ($PHPUNIT_VERSION < 8.0) {
$argv = array_filter($argv, function ($v) use (&$argc) { if ('--do-not-cache-result' !== $v) return true; --$argc; });
} elseif (filter_var(getenv('SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE'), FILTER_VALIDATE_BOOLEAN)) {
$argv[] = '--do-not-cache-result';
++$argc;
}
$components = array();
$cmd = array_map('escapeshellarg', $argv);
$exit = 0;
@@ -47,7 +47,7 @@
},
"conflict": {
"symfony/console": "<3.4",
"symfony/form": "<4.3",
"symfony/form": "<4.3.4",
"symfony/http-foundation": "<4.3",
"symfony/translation": "<4.2",
"symfony/workflow": "<4.3"
@@ -366,9 +366,9 @@ public function getPath()
/**
* Normalizes the value before any other normalization is applied.
*
* @param $value
* @param mixed $value
*
* @return The normalized array value
* @return mixed The normalized array value
*/
protected function preNormalize($value)
{
@@ -282,7 +282,6 @@ public function testEmptyConfigFromMoreThanOneSource()
$container = new ContainerBuilder();
$container->registerExtension(new EnvExtension(new ConfigurationWithArrayNodeRequiringOneElement()));
$container->loadFromExtension('env_extension', []);
$container->loadFromExtension('env_extension', []);
$this->doProcess($container);
@@ -1539,7 +1539,6 @@ public function testGetLanguages()
$request = new Request();
$request->headers->set('Accept-language', 'zh, en-us; q=0.8, en; q=0.6');
$this->assertEquals(['zh', 'en_US', 'en'], $request->getLanguages());
$this->assertEquals(['zh', 'en_US', 'en'], $request->getLanguages());
$request = new Request();
$request->headers->set('Accept-language', 'zh, en-us; q=0.6, en; q=0.8');
@@ -533,7 +533,6 @@ public function testPrepareRemovesContentForInformationalResponse()
$response->prepare($request);
$this->assertEquals('', $response->getContent());
$this->assertFalse($response->headers->has('Content-Type'));
$this->assertFalse($response->headers->has('Content-Type'));
$response->setContent('content');
$response->setStatusCode(304);
@@ -27,7 +27,7 @@
class LanguageDataGenerator extends AbstractDataGenerator
{
/**
* Source: https://iso639-3.sil.org/code_tables/639/data
* Source: https://iso639-3.sil.org/code_tables/639/data.
*/
private static $preferredAlpha2ToAlpha3Mapping = [
'ak' => 'aka',
@@ -167,8 +167,9 @@ function printTable($translations, $verboseOutput)
$longestLocaleNameLength = max(array_map('strlen', array_keys($translations)));
foreach ($translations as $locale => $translation) {
$isTranslationCompleted = $translation['translated'] === $translation['total'];
if ($isTranslationCompleted) {
if ($translation['translated'] > $translation['total']) {
textColorRed();
} elseif ($translation['translated'] === $translation['total']) {
textColorGreen();
}
@@ -194,6 +195,11 @@ function textColorGreen()
echo "\033[32m";
}
function textColorRed()
{
echo "\033[31m";
}
function textColorNormal()
{
echo "\033[0m";

0 comments on commit 9d9f558

Please sign in to comment.
You can’t perform that action at this time.