[Form] Added tests

This commit is contained in:
William DURAND 2012-05-12 16:52:34 +02:00
parent 6d5ad3b289
commit df36afb123
3 changed files with 30 additions and 0 deletions

View File

@ -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'));
}
}

View File

@ -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'));
}
}

View File

@ -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'));
}
}