Przeglądaj źródła

[Tests][Locale] locale supported INTL_ICU_VERSION, use ReflectionExtension to find ICU version

stealth35 14 lat temu
rodzic
commit
7dc4e2430f

+ 7 - 1
tests/Symfony/Tests/Component/Locale/TestCase.php

@@ -75,8 +75,14 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
             throw new \RuntimeException('The intl extension is not available');
         }
 
+        if (defined(INTL_ICU_VERSION)) {
+            return INTL_ICU_VERSION;
+        }
+
+        $reflector = new \ReflectionExtension('intl');
+
         ob_start();
-        phpinfo(INFO_MODULES);
+        $reflector->info();
         $output = ob_get_clean();
 
         preg_match('/^ICU version => (.*)$/m', $output, $matches);