8000 1. Separated testing diacritic letters with additional check for mbst… · scp/symfony@0b1abb3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b1abb3

Browse files
author
Shein Alexey
committed
1. Separated testing diacritic letters with additional check for mbstring in Symfony\Tests\Component\Console\Helper\FormatterHelperTest.php.
2. Added check if French locale was correctly set, skip the test otherwise in Symfony\Tests\Component\Yaml\InlineTest.php. 3. Inverted check for Windows platform since testing finding php with suffixes has meaning only in Windows in Symfony\Tests\Component\Process\PhpExecutableFinderTest.php.
1 parent 2e8fe92 commit 0b1abb3

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

tests/Symfony/Tests/Component/Console/Helper/FormatterHelperTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ public function testFormatBlock()
5050
$formatter->formatBlock('Some text to display', 'error', true),
5151
'::formatBlock() formats a message in a block'
5252
);
53+
}
54+
55+
public function testFormatBlockWithDiacriticLetters() {
56+
57+
if (!extension_loaded('mbstring')) {
58+
$this->markTestSkipped('This test requires mbstring to work.');
59+
}
60+
61+
$formatter = new FormatterHelper();
5362

5463
$this->assertEquals(
5564
'<error> </error>' . "\n" .

tests/Symfony/Tests/Component/Process/PhpExecutableFinderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testFindWithSuffix()
4848
$current = $f->find();
4949

5050
//TODO maybe php executable is custom or even windows
51-
if (false === strstr(PHP_OS, 'WIN')) {
51+
if (false !== strstr(PHP_OS, 'WIN')) {
5252
$this->assertEquals($current, PHP_BINDIR.DIRECTORY_SEPARATOR.'php', '::find() returns the executable php with suffixes');
5353
}
5454
}

tests/Symfony/Tests/Component/Yaml/InlineTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ public function testDumpNumericValueWithLocale()
4747
$this->markTestSkipped('Your platform does not support locales.');
4848
}
4949

50-
setlocale(LC_ALL, 'fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252');
50+
$required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252');
51+
if (false === setlocale(LC_ALL, $required_locales)) {
52+
$this->markTestSkipped('Could not set any of required locales: ' . implode(", ", $required_locales));
53+
}
5154

5255
$this->assertEquals('1.2', Inline::dump(1.2));
5356
$this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0)));

0 commit comments

Comments
 (0)
0