00001 <?php 00008 class UTDate extends foUnitTestBase 00009 { 00010 public function doTest() 00011 { 00012 $this->_testIsValidDate(); 00013 $this->_testIsValidTime(); 00014 } 00015 00016 private function _testIsValidDate() 00017 { 00018 $this->setSectionLabel('isValidDate'); 00019 eval($this->needTrue('isValidDate("2006-01-01")')); 00020 eval($this->needTrue('isValidDate("2006-01-01 21:02:02")')); 00021 eval($this->needTrue('isValidDate("now")')); 00022 eval($this->needTrue('isValidDate("12jan2009")')); 00023 eval($this->needFalse('isValidDate("2009jan12")')); 00024 eval($this->needFalse('isValidDate("asdfasf")')); 00025 eval($this->needFalse('isValidDate("")')); 00026 } 00027 00028 private function _testIsValidTime() 00029 { 00030 $this->setSectionLabel('isValidTime'); 00031 eval($this->needTrue('isValidTime("21:02:02")')); 00032 eval($this->needFalse('isValidTime("21:00")')); 00033 eval($this->needFalse('isValidTime("25:02:02")')); 00034 eval($this->needFalse('isValidTime("21:62:02")')); 00035 eval($this->needFalse('isValidTime("21:02:62")')); 00036 eval($this->needFalse('isValidTime("2009jan12")')); 00037 eval($this->needFalse('isValidTime("asdfasf")')); 00038 eval($this->needFalse('isValidTime("")')); 00039 } 00040 } 00041 ?>