public function testValueReturnedFromComposedDateTimeIsRfc3339FullDateFormat() { $element = new DateElement('foo'); $date = new DateTime(); $element->setValue($date); $value = $element->getValue(); $this->assertEquals($date->format('Y-m-d'), $value); }
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))); }