Skip to content
Permalink
Browse files

Skip datetime string formatting test for old ICU.

Remove travis job on php nightly.
  • Loading branch information...
ADmad committed Apr 22, 2016
1 parent 99c05d9 commit 3c750069d3ed88e19ec60c446da408b48b923e89
Showing with 52 additions and 1 deletion.
  1. +0 −1 .travis.yml
  2. +26 −0 tests/TestCase/I18n/DateTest.php
  3. +26 −0 tests/TestCase/I18n/TimeTest.php
@@ -4,7 +4,6 @@ php:
- 5.5
- 5.6
- 7.0
- nightly

sudo: false

@@ -31,6 +31,28 @@ 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
*
@@ -150,6 +172,10 @@ public function testNice($class)
*/
public function testJsonSerialize($class)
{
if (static::$icuVersion < 50) {
$this->markTestSkipped('ICU 5x is needed');
}
$date = new $class('2015-11-06 11:32:45');
$this->assertEquals('"2015-11-06T00:00:00+00:00"', json_encode($date));
}
@@ -25,6 +25,28 @@
*/
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
*
@@ -710,6 +732,10 @@ public function testDiffForHumansNow($class)
*/
public function testJsonEnconde($class)
{
if (static::$icuVersion < 50) {
$this->markTestSkipped('ICU 5x is needed');
}
$time = new $class('2014-04-20 10:10:10');
$this->assertEquals('"2014-04-20T10:10:10+00:00"', json_encode($time));

0 comments on commit 3c75006

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