Skip to content

Commit

Permalink
Use already available INTL_ICU_VERSION constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Apr 23, 2016
1 parent 3c75006 commit 3d61835
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 46 deletions.
24 changes: 1 addition & 23 deletions tests/TestCase/I18n/DateTest.php
Expand Up @@ -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
*
Expand Down Expand Up @@ -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');
}

Expand Down
24 changes: 1 addition & 23 deletions tests/TestCase/I18n/TimeTest.php
Expand Up @@ -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
*
Expand Down Expand Up @@ -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');
}

Expand Down

0 comments on commit 3d61835

Please sign in to comment.