8000 [Form] Added tests · symfony/symfony@df36afb · GitHub
[go: up one dir, main page]

Skip to content

Commit df36afb

Browse files
committed
[Form] Added tests
1 parent 6d5ad3b commit df36afb

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,14 @@ public function testInitializeWithDateTime()
259259
// to null in the type
260260
$this->factory->create('datetime', new \DateTime());
261261
}
262+
263+
public function testSingleTextWidgetShouldUseTheRightInputType()
264+
{
265+
$form = $this->factory->create('datetime', null, array(
266+
'widget' => 'single_text',
267+
));
268+
269+
$view = $form->createView();
270+
$this->assertEquals('datetime', $view->get('type'));
271+
}
262272
}

src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,4 +536,14 @@ public function testInitializeWithDateTime()
536536
// to null in the type
537537
$this->factory->create('date', new \DateTime());
538538
}
539+
540+
public function testSingleTextWidgetShouldUseTheRightInputType()
541+
{
542+
$form = $this->factory->create('date', null, array(
543+
'widget' => 'single_text',
544+
));
545+
546+
$view = $form->createView();
547+
$this->assertEquals('date', $view->get('type'));
548+
}
539549
}

src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,4 +406,14 @@ public function testInitializeWithDateTime()
406406
// to null in the type
407407
$this->factory->create('time', new \DateTime());
408408
}
409+
410+
public function testSingleTextWidgetShouldUseTheRightInputType()
411+
{
412+
$form = $this->factory->create('time', null, array(
413+
'widget' => 'single_text',
414+
));
415+
416+
$view = $form->createView();
417+
$this->assertEquals('time', $view->get('type'));
418+
}
409419
}

0 commit comments

Comments
 (0)
0