function testWithOutParams() { $date = new lmbDateTime('2004-12-20 10:15:30'); $time = $date->getStamp(); $code = '{$#var|i18n_date}'; $tpl = $this->_createMacroTemplate($code, 'tpl.html'); $tpl->set('var', $time); $out = $tpl->render(); $this->assertEqual($out, '12/20/2004'); }
function testGetStamp() { $date = new lmbDateTime($stamp = mktime(21, 45, 13, 12, 1, 2005)); $this->assertEqual($date->getStamp(), $stamp); }
function testComplexPathBasedDBEWithDefinedFormat() { $date = new lmbDateTime('2005-01-20 10:15:30'); $template = '{$my.var|i18n_date:"en", "stamp", "", "%Y %m %d"}'; $this->registerTestingTemplate('/limb/locale_date_filter_path_based_dbe_defined_format.html', $template); $page = $this->initTemplate('/limb/locale_date_filter_path_based_dbe_defined_format.html'); $my_dataspace = new lmbSet(array('var' => $date->getStamp())); $page->set('my', $my_dataspace); $this->assertEqual($page->capture(), '2005 01 20'); }