|
@@ -234,4 +234,22 @@ class DateTimeTypeTest extends LocalizedTestCase
|
|
$this->assertEquals(array(new FormError('Customized invalid message', array())), $form['date']->getErrors());
|
|
$this->assertEquals(array(new FormError('Customized invalid message', array())), $form['date']->getErrors());
|
|
$this->assertEquals(array(new FormError('Customized invalid message', array())), $form['time']->getErrors());
|
|
$this->assertEquals(array(new FormError('Customized invalid message', array())), $form['time']->getErrors());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public function testSubmit_invalidDateTimeSingleText()
|
|
|
|
+ {
|
|
|
|
+ $form = $this->factory->create('datetime', null, array(
|
|
|
|
+ 'data_timezone' => 'UTC',
|
|
|
|
+ 'user_timezone' => 'UTC',
|
|
|
|
+ 'input' => 'datetime',
|
|
|
|
+ 'widget' => 'single_text',
|
|
|
|
+ 'invalid_message' => 'Customized invalid message',
|
|
|
|
+ ));
|
|
|
|
+
|
|
|
|
+ $form->bind('2012-04-31 03:04:05');
|
|
|
|
+
|
|
|
|
+ $this->assertFalse($form->isValid());
|
|
|
|
+ $this->assertNull($form->getData());
|
|
|
|
+ $this->assertEquals('2012-04-31 03:04:05', $form->getClientData());
|
|
|
|
+ $this->assertEquals(array(new FormError('Customized invalid message', array())), $form->getErrors());
|
|
|
|
+ }
|
|
}
|
|
}
|