Bladeren bron

merged branch stealth35/master (PR #1346)

Commits
-------

6436da2 added quote
7dc4e24 [Tests][Locale] locale supported INTL_ICU_VERSION, use ReflectionExtension to find ICU version

Discussion
----------

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

---------------------------------------------------------------------------

by igorw at 2011/06/16 03:44:25 -0700

Nice.

`INTL_ICU_VERSION` is PHP 5.4 only, right?

Also, it may be possible to use:

    $output = \ReflectionExtension::export('intl', true);

That way we can get rid of the output buffering.

---------------------------------------------------------------------------

by stloyd at 2011/06/16 03:49:22 -0700

@igorw It will be added in PHP 5.3.7 to.

---------------------------------------------------------------------------

by stealth35 at 2011/06/16 04:04:09 -0700

@igorw no export don't return the info table
Fabien Potencier 14 jaren geleden
bovenliggende
commit
42709c0ed8
1 gewijzigde bestanden met toevoegingen van 7 en 1 verwijderingen
  1. 7 1
      tests/Symfony/Tests/Component/Locale/TestCase.php

+ 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);