Skip to content
Snippets Groups Projects
Commit ec3b241d authored by Gerrit Uitslag's avatar Gerrit Uitslag
Browse files

improve IXR_Date unittests

parent 47ab76cc
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,9 @@
require_once DOKU_INC.'inc/IXR_Library.php';
/**
* Class ixr_library_date_test
*/
class ixr_library_date_test extends DokuWikiTest {
......@@ -19,7 +22,7 @@ class ixr_library_date_test extends DokuWikiTest {
// with timezone
array('2010-08-17 09:23:14+0000', 1282036994),
array('2010-08-17 09:23:14+00:00', 1282036994),
array('2010-08-17 09:23:14+03:00', 1282036994),
array('2010-08-17 12:23:14+03:00', 1282036994),
// no seconds
array('2010-08-17T09:23', 1282036980),
......@@ -28,12 +31,12 @@ class ixr_library_date_test extends DokuWikiTest {
// no time
array('2010-08-17', 1282003200),
array(1282036980, 1282036980),
//array('20100817', 1282003200), #this will NOT be parsed, but is assumed to be timestamp
// array('20100817', 1282003200), #this will NOT be parsed, but is assumed to be timestamp
);
foreach($tests as $test){
$dt = new IXR_Date($test[0]);
$this->assertEquals($dt->getTimeStamp(),$test[1]);
$this->assertEquals($test[1], $dt->getTimeStamp());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment