|
@@ -108,7 +108,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testParseLocalizedDate() {
|
|
public function testParseLocalizedDate() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
|
|
|
|
|
$ret = TimeLib::parseLocalizedDate('15-Feb-2009', 'j-M-Y', 'start');
|
|
$ret = TimeLib::parseLocalizedDate('15-Feb-2009', 'j-M-Y', 'start');
|
|
|
//$this->debug($ret);
|
|
//$this->debug($ret);
|
|
@@ -144,7 +144,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testPeriod() {
|
|
public function testPeriod() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
$values = array(
|
|
$values = array(
|
|
|
array(__('Today'), array(date(FORMAT_DB_DATETIME, mktime(0, 0, 0, date('m'), date('d'), date('Y'))), date(FORMAT_DB_DATETIME, mktime(23, 59, 59, date('m'), date('d'), date('Y'))))),
|
|
array(__('Today'), array(date(FORMAT_DB_DATETIME, mktime(0, 0, 0, date('m'), date('d'), date('Y'))), date(FORMAT_DB_DATETIME, mktime(23, 59, 59, date('m'), date('d'), date('Y'))))),
|
|
|
|
|
|
|
@@ -168,7 +168,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testPeriodAsSql() {
|
|
public function testPeriodAsSql() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
$values = array(
|
|
$values = array(
|
|
|
array(__('Today'), "(Model.field >= '".date(FORMAT_DB_DATE)." 00:00:00') AND (Model.field <= '".date(FORMAT_DB_DATE)." 23:59:59')"),
|
|
array(__('Today'), "(Model.field >= '".date(FORMAT_DB_DATE)." 00:00:00') AND (Model.field <= '".date(FORMAT_DB_DATE)." 23:59:59')"),
|
|
|
array(__('Yesterday').' '.__('until').' '.__('Today'), "(Model.field >= '".date(FORMAT_DB_DATE, time()-DAY)." 00:00:00') AND (Model.field <= '".date(FORMAT_DB_DATE)." 23:59:59')"),
|
|
array(__('Yesterday').' '.__('until').' '.__('Today'), "(Model.field >= '".date(FORMAT_DB_DATE, time()-DAY)." 00:00:00') AND (Model.field <= '".date(FORMAT_DB_DATE)." 23:59:59')"),
|
|
@@ -186,7 +186,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testDifference() {
|
|
public function testDifference() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
$values = array(
|
|
$values = array(
|
|
|
array('2010-02-23 11:11:11', '2010-02-23 11:12:01', 50),
|
|
array('2010-02-23 11:11:11', '2010-02-23 11:12:01', 50),
|
|
|
array('2010-02-23 11:11:11', '2010-02-24 11:12:01', DAY+50)
|
|
array('2010-02-23 11:11:11', '2010-02-24 11:12:01', DAY+50)
|
|
@@ -199,7 +199,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testAgeBounds() {
|
|
public function testAgeBounds() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
$values = array(
|
|
$values = array(
|
|
|
array(20, 20, array('min'=>'1990-07-07', 'max'=>'1991-07-06')),
|
|
array(20, 20, array('min'=>'1990-07-07', 'max'=>'1991-07-06')),
|
|
|
array(10, 30, array('min'=>'1980-07-07', 'max'=>'2001-07-06')),
|
|
array(10, 30, array('min'=>'1980-07-07', 'max'=>'2001-07-06')),
|
|
@@ -219,7 +219,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testAgeByYear() {
|
|
public function testAgeByYear() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
|
|
|
|
|
# year only
|
|
# year only
|
|
|
$is = TimeLib::ageByYear(2000);
|
|
$is = TimeLib::ageByYear(2000);
|
|
@@ -246,7 +246,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testDaysInMonth() {
|
|
public function testDaysInMonth() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
|
|
|
|
|
$ret = TimeLib::daysInMonth('2004', '3');
|
|
$ret = TimeLib::daysInMonth('2004', '3');
|
|
|
$this->assertEquals($ret, 31);
|
|
$this->assertEquals($ret, 31);
|
|
@@ -262,7 +262,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testDay() {
|
|
public function testDay() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
$ret = TimeLib::day('0');
|
|
$ret = TimeLib::day('0');
|
|
|
$this->assertEquals(__('Sunday'), $ret);
|
|
$this->assertEquals(__('Sunday'), $ret);
|
|
|
|
|
|
|
@@ -283,7 +283,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testMonth() {
|
|
public function testMonth() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
$ret = TimeLib::month('11');
|
|
$ret = TimeLib::month('11');
|
|
|
$this->assertEquals(__('November'), $ret);
|
|
$this->assertEquals(__('November'), $ret);
|
|
|
|
|
|
|
@@ -298,20 +298,20 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testDays() {
|
|
public function testDays() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
$ret = TimeLib::days();
|
|
$ret = TimeLib::days();
|
|
|
$this->assertTrue(count($ret) === 7);
|
|
$this->assertTrue(count($ret) === 7);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testMonths() {
|
|
public function testMonths() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
$ret = TimeLib::months();
|
|
$ret = TimeLib::months();
|
|
|
$this->assertTrue(count($ret) === 12);
|
|
$this->assertTrue(count($ret) === 12);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testRelLengthOfTime() {
|
|
public function testRelLengthOfTime() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
|
|
|
|
|
$ret = TimeLib::relLengthOfTime('1990-11-20');
|
|
$ret = TimeLib::relLengthOfTime('1990-11-20');
|
|
|
//pr($ret);
|
|
//pr($ret);
|
|
@@ -321,7 +321,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testLengthOfTime() {
|
|
public function testLengthOfTime() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
|
|
|
|
|
$ret = TimeLib::lengthOfTime(60);
|
|
$ret = TimeLib::lengthOfTime(60);
|
|
|
//pr($ret);
|
|
//pr($ret);
|
|
@@ -335,7 +335,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testFuzzyFromOffset() {
|
|
public function testFuzzyFromOffset() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
|
|
|
|
|
$ret = TimeLib::fuzzyFromOffset(MONTH);
|
|
$ret = TimeLib::fuzzyFromOffset(MONTH);
|
|
|
//pr($ret);
|
|
//pr($ret);
|
|
@@ -359,7 +359,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testCweekDay() {
|
|
public function testCweekDay() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
|
|
|
|
|
# wednesday
|
|
# wednesday
|
|
|
$ret = TimeLib::cweekDay(51, 2011, 2);
|
|
$ret = TimeLib::cweekDay(51, 2011, 2);
|
|
@@ -370,7 +370,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testCweeks() {
|
|
public function testCweeks() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
$ret = TimeLib::cweeks('2004');
|
|
$ret = TimeLib::cweeks('2004');
|
|
|
$this->assertEquals($ret, 53);
|
|
$this->assertEquals($ret, 53);
|
|
|
|
|
|
|
@@ -390,7 +390,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testCweekBeginning() {
|
|
public function testCweekBeginning() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
$values = array(
|
|
$values = array(
|
|
|
'2001' => 978303600, # Mon 01.01.2001, 00:00
|
|
'2001' => 978303600, # Mon 01.01.2001, 00:00
|
|
|
'2006' => 1136156400, # Mon 02.01.2006, 00:00
|
|
'2006' => 1136156400, # Mon 02.01.2006, 00:00
|
|
@@ -423,7 +423,7 @@ class TimeLibTest extends MyCakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testCweekEnding() {
|
|
public function testCweekEnding() {
|
|
|
- $this->out($this->_header(__FUNCTION__));
|
|
|
|
|
|
|
+ $this->out($this->_header(__FUNCTION__), true);
|
|
|
|
|
|
|
|
$values = array(
|
|
$values = array(
|
|
|
'2001' => 1009753199, # Sun 30.12.2001, 23:59:59
|
|
'2001' => 1009753199, # Sun 30.12.2001, 23:59:59
|