Skip to content
Permalink
Browse files

Use already available INTL_ICU_VERSION constant.

  • Loading branch information...
ADmad committed Apr 23, 2016
1 parent 3c75006 commit 3d61835856990ef74560def8b8c9101fb41c5345
Showing with 2 additions and 46 deletions.
  1. +1 −23 tests/TestCase/I18n/DateTest.php
  2. +1 −23 tests/TestCase/I18n/TimeTest.php
@@ -31,28 +31,6 @@ class DateTest extends TestCase
*/
protected $locale;
/**
* icuVersion
*
* @var int
*/
protected static $icuVersion;
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
ob_start();
phpinfo();
$phpinfo = ob_get_clean();
preg_match('/ICU version => ([\d\.]+)/', $phpinfo, $matches);
static::$icuVersion = (int)$matches[1];
}
/**
* setup
*
@@ -172,7 +150,7 @@ public function testNice($class)
*/
public function testJsonSerialize($class)
{
if (static::$icuVersion < 50) {
if (version_compare(INTL_ICU_VERSION, '50.0', '<')) {
$this->markTestSkipped('ICU 5x is needed');
}
@@ -25,28 +25,6 @@
*/
class TimeTest extends TestCase
{
/**
* icuVersion
*
* @var int
*/
protected static $icuVersion;
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
ob_start();
phpinfo();
$phpinfo = ob_get_clean();
preg_match('/ICU version => ([\d\.]+)/', $phpinfo, $matches);
static::$icuVersion = (int)$matches[1];
}
/**
* setUp method
*
@@ -732,7 +710,7 @@ public function testDiffForHumansNow($class)
*/
public function testJsonEnconde($class)
{
if (static::$icuVersion < 50) {
if (version_compare(INTL_ICU_VERSION, '50.0', '<')) {
$this->markTestSkipped('ICU 5x is needed');
}

0 comments on commit 3d61835

Please sign in to comment.
You can’t perform that action at this time.