[Form] Added tests
This commit is contained in:
parent
6d5ad3b289
commit
df36afb123
@ -259,4 +259,14 @@ class DateTimeTypeTest extends LocalizedTestCase
|
||||
// to null in the type
|
||||
$this->factory->create('datetime', new \DateTime());
|
||||
}
|
||||
|
||||
public function testSingleTextWidgetShouldUseTheRightInputType()
|
||||
{
|
||||
$form = $this->factory->create('datetime', null, array(
|
||||
'widget' => 'single_text',
|
||||
));
|
||||
|
||||
$view = $form->createView();
|
||||
$this->assertEquals('datetime', $view->get('type'));
|
||||
}
|
||||
}
|
||||
|
@ -536,4 +536,14 @@ class DateTypeTest extends LocalizedTestCase
|
||||
// to null in the type
|
||||
$this->factory->create('date', new \DateTime());
|
||||
}
|
||||
|
||||
public function testSingleTextWidgetShouldUseTheRightInputType()
|
||||
{
|
||||
$form = $this->factory->create('date', null, array(
|
||||
'widget' => 'single_text',
|
||||
));
|
||||
|
||||
$view = $form->createView();
|
||||
$this->assertEquals('date', $view->get('type'));
|
||||
}
|
||||
}
|
||||
|
@ -406,4 +406,14 @@ class TimeTypeTest extends LocalizedTestCase
|
||||
// to null in the type
|
||||
$this->factory->create('time', new \DateTime());
|
||||
}
|
||||
|
||||
public function testSingleTextWidgetShouldUseTheRightInputType()
|
||||
{
|
||||
$form = $this->factory->create('time', null, array(
|
||||
'widget' => 'single_text',
|
||||
));
|
||||
|
||||
$view = $form->createView();
|
||||
$this->assertEquals('time', $view->get('type'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user