123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?php
- namespace Symfony\Component\Intl\Util;
- use PHPUnit\Framework\TestCase;
- use Symfony\Component\Intl\Intl;
- class IntlTestHelper
- {
-
- public static function requireIntl(TestCase $testCase, $minimumIcuVersion = null)
- {
- if (null === $minimumIcuVersion) {
- $minimumIcuVersion = Intl::getIcuStubVersion();
- }
-
-
-
-
-
- if (($minimumIcuVersion || defined('HHVM_VERSION_ID')) && IcuVersion::compare(Intl::getIcuVersion(), $minimumIcuVersion, '<', 1)) {
- $testCase->markTestSkipped('ICU version '.$minimumIcuVersion.' is required.');
- }
-
-
- \Locale::setDefault('en');
-
-
-
-
-
-
-
-
- }
-
- public static function requireFullIntl(TestCase $testCase, $minimumIcuVersion = null)
- {
-
- if (!Intl::isExtensionLoaded()) {
- $testCase->markTestSkipped('Extension intl is required.');
- }
- self::requireIntl($testCase, $minimumIcuVersion);
-
-
-
-
-
-
- }
-
- public static function require32Bit(TestCase $testCase)
- {
- if (4 !== PHP_INT_SIZE) {
- $testCase->markTestSkipped('PHP 32 bit is required.');
- }
- }
-
- public static function require64Bit(TestCase $testCase)
- {
- if (8 !== PHP_INT_SIZE) {
- $testCase->markTestSkipped('PHP 64 bit is required.');
- }
- }
-
- private function __construct()
- {
- }
- }
|