8000 Merge branch '3.4' into 4.3 · symfony/symfony@9d9f558 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d9f558

Browse files
Merge branch '3.4' into 4.3
* 3.4: cleanups Disable PHPUnit result cache on the CI [Translation] Highlight invalid translation status
2 parents 6070daa + 7fb7f59 commit 9d9f558

File tree

10 files changed

+22
-9
lines changed

10 files changed

+22
-9
lines changed

.appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ init:
1212
- SET SYMFONY_DEPRECATIONS_HELPER=strict
1313
- SET "SYMFONY_REQUIRE=>=4.2"
1414
- SET ANSICON=121x90 (121x90)
15+
- SET SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1
1516
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f
1617

1718
install:

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env:
2121
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/shims/php
2222
- MESSENGER_AMQP_DSN=amqp://localhost/%2f/messages
2323
- MESSENGER_REDIS_DSN=redis://127.0.0.1:7001/messages
24+
- SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1
2425

2526
matrix:
2627
include:

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,14 @@ class SymfonyBlacklistPhpunit {}
166166
global $argv, $argc;
167167
$argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
168168
$argc = isset($_SERVER['argc']) ? $_SERVER['argc'] : 0;
169+
170+
if ($PHPUNIT_VERSION < 8.0) {
171+
$argv = array_filter($argv, function ($v) use (&$argc) { if ('--do-not-cache-result' !== $v) return true; --$argc; });
172+
} elseif (filter_var(getenv('SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE'), FILTER_VALIDATE_BOOLEAN)) {
173+
$argv[] = '--do-not-cache-result';
174+
++$argc;
175+
}
176+
169177
$components = array();
170178
$cmd = array_map('escapeshellarg', $argv);
171179
$exit = 0;

src/Symfony/Bridge/Twig/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"conflict": {
4949
"symfony/console": "<3.4",
50-
"symfony/form": "<4.3",
50+
"symfony/form": "<4.3.4",
5151
"symfony/http-foundation": "<4.3",
5252
"symfony/translation": "<4.2",
5353
"symfony/workflow": "<4.3"

src/Symfony/Component/Config/Definition/BaseNode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,9 @@ final public function normalize($value)
366366
/**
367367
* Normalizes the value before any other normalization is applied.
368368
*
369-
* @param $value
369+
* @param mixed $value
370370
*
371-
* @return The normalized array value
371+
* @return mixed The normalized array value
372372
*/
373373
protected function preNormalize($value)
374374
{

src/Symfony/Component/DependencyInjection/Tests/Compiler/ValidateEnvPlaceholdersPassTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ public function testEmptyConfigFromMoreThanOneSource()
282282
$container = new ContainerBuilder();
283283
$container->registerExtension(new EnvExtension(new ConfigurationWithArrayNodeRequiringOneElement()));
284284
$container->loadFromExtension('env_extension', []);
285-
$container->loadFromExtension('env_extension', []);
286285

287286
$this->doProcess($container);
288287

src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,6 @@ public function testGetLanguages()
15391539
$request = new Request();
15401540
$request->headers->set('Accept-language', 'zh, en-us; q=0.8, en; q=0.6');
15411541
$this->assertEquals(['zh', 'en_US', 'en'], $request->getLanguages());
1542-
$this->assertEquals(['zh', 'en_US', 'en'], $request->getLanguages());
15431542

15441543
$request = new Request();
15451544
$request->headers->set('Accept-language', 'zh, en-us; q=0.6, en; q=0.8');

src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,6 @@ public function testPrepareRemovesContentForInformationalResponse()
533533
$response->prepare($request);
534534
$this->assertEquals('', $response->getContent());
535535
$this->assertFalse($response->headers->has('Content-Type'));
536-
$this->assertFalse($response->headers->has('Content-Type'));
537536

538537
$response->setContent('content');
539538
$response->setStatusCode(304);

src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
class LanguageDataGenerator extends AbstractDataGenerator
2828
{
2929
/**
30-
* Source: https://iso639-3.sil.org/code_tables/639/data
30+
* Source: https://iso639-3.sil.org/code_tables/639/data.
3131
*/
3232
private static $preferredAlpha2ToAlpha3Mapping = [
3333
'ak' => 'aka',

src/Symfony/Component/Translation/Resources/bin/translation-status.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ function printTable($translations, $verboseOutput)
167167
$longestLocaleNameLength = max(array_map('strlen', array_keys($translations)));
168168

169169
foreach ($translations as $locale => $translation) {
170-
$isTranslationCompleted = $translation['translated'] === $translation['total'];
171-
if ($isTranslationCompleted) {
170+
if ($translation['translated'] > $translation['total']) {
171+
textColorRed();
172+
} elseif ($translation['translated'] === $translation['total']) {
172173
textColorGreen();
173174
}
174175

@@ -194,6 +195,11 @@ function textColorGreen()
194195
echo "\033[32m";
195196
}
196197

198+
function textColorRed()
199+
{
200+
echo "\033[31m";
201+
}
202+
197203
function textColorNormal()
198204
{
199205
echo "\033[0m";

0 commit comments

Comments
 (0)
0