Преглед на файлове

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.

Shein Alexey преди 13 години
родител
ревизия
0b1abb3a57

+ 9 - 0
tests/Symfony/Tests/Component/Console/Helper/FormatterHelperTest.php

@@ -50,6 +50,15 @@ class FormatterHelperTest extends \PHPUnit_Framework_TestCase
             $formatter->formatBlock('Some text to display', 'error', true),
             '::formatBlock() formats a message in a block'
         );
+    }
+
+    public function testFormatBlockWithDiacriticLetters() {
+
+        if (!extension_loaded('mbstring')) {
+            $this->markTestSkipped('This test requires mbstring to work.');
+        }
+
+        $formatter = new FormatterHelper();
 
         $this->assertEquals(
             '<error>                       </error>' . "\n" .

+ 1 - 1
tests/Symfony/Tests/Component/Process/PhpExecutableFinderTest.php

@@ -48,7 +48,7 @@ class PhpExecutableFinderTest extends \PHPUnit_Framework_TestCase
         $current = $f->find();
 
         //TODO maybe php executable is custom or even windows
-        if (false === strstr(PHP_OS, 'WIN')) {
+        if (false !== strstr(PHP_OS, 'WIN')) {
             $this->assertEquals($current, PHP_BINDIR.DIRECTORY_SEPARATOR.'php', '::find() returns the executable php with suffixes');
         }
     }

+ 4 - 1
tests/Symfony/Tests/Component/Yaml/InlineTest.php

@@ -47,7 +47,10 @@ class InlineTest extends \PHPUnit_Framework_TestCase
             $this->markTestSkipped('Your platform does not support locales.');
         }
 
-        setlocale(LC_ALL, 'fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252');
+        $required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252');
+        if (false === setlocale(LC_ALL, $required_locales)) {
+            $this->markTestSkipped('Could not set any of required locales: ' . implode(", ", $required_locales));
+        }
 
         $this->assertEquals('1.2', Inline::dump(1.2));
         $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0)));