示例#1
0
文件: DateTest.php 项目: nieldm/zf2
 public function testValueReturnedFromComposedDateTimeIsRfc3339FullDateFormat()
 {
     $element = new DateElement('foo');
     $date = new DateTime();
     $element->setValue($date);
     $value = $element->getValue();
     $this->assertEquals($date->format('Y-m-d'), $value);
 }
示例#2
0
 public function testErrorShowTwice()
 {
     $element = new Element\Date('birth');
     $element->setFormat('Y-m-d');
     $element->setValue('2010-13-13');
     $validator = new \Zend\Validator\Date();
     $validator->isValid($element->getValue());
     $element->setMessages($validator->getMessages());
     $markup = $this->helper->__invoke($element);
     $this->assertEquals(2, count(explode("<ul><li>The input does not appear to be a valid date</li></ul>", $markup)));
 }