mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 05:37:32 +02:00
Date test terms()
This commit is contained in:
@@ -241,13 +241,21 @@
|
|||||||
public function testTerms()
|
public function testTerms()
|
||||||
{
|
{
|
||||||
|
|
||||||
$data = $this->dateObj->terms();
|
$tests = array(
|
||||||
|
0 => array('day-shortest', 'We'),
|
||||||
|
1 => array('day-short', 'Wed'),
|
||||||
|
2 => array('day', 'Wednesday'),
|
||||||
|
3 => array('month', 'February'),
|
||||||
|
4 => array('month-short', 'Feb'),
|
||||||
|
);
|
||||||
|
|
||||||
$result = ($data[1] === 'January' && $data[12] === 'December') ? true : false;
|
foreach($tests as $var)
|
||||||
|
{
|
||||||
$this->assertTrue($result);
|
list($input, $expected) = $var;
|
||||||
|
$data = $this->dateObj->terms($input);
|
||||||
// $this->fail(print_r($result,true));
|
$this->assertEquals($expected, $data[2]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user