Fix WeekType tests

This commit is contained in:
Thomas Calvet 2019-11-05 22:39:12 +01:00
parent a307733751
commit 906b82eb97
2 changed files with 12 additions and 4 deletions

View File

@ -2771,11 +2771,11 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
{
$this->requiresFeatureSet(404);
$data = ['year' => date('Y'), 'week' => 1];
$data = ['year' => (int) date('Y'), 'week' => 1];
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', $data, [
'input' => 'array',
'required' => false,
'widget' => 'choice',
]);
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],

View File

@ -2768,6 +2768,8 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
public function testWeekSingleText()
{
$this->requiresFeatureSet(404);
$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
'input' => 'string',
'widget' => 'single_text',
@ -2785,6 +2787,8 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
public function testWeekSingleTextNoHtml5()
{
$this->requiresFeatureSet(404);
$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
'input' => 'string',
'widget' => 'single_text',
@ -2803,11 +2807,13 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
public function testWeekChoices()
{
$data = ['year' => date('Y'), 'week' => 1];
$this->requiresFeatureSet(404);
$data = ['year' => (int) date('Y'), 'week' => 1];
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', $data, [
'input' => 'array',
'required' => false,
'widget' => 'choice',
]);
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
@ -2827,6 +2833,8 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
public function testWeekText()
{
$this->requiresFeatureSet(404);
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '2000-W01', [
'input' => 'string',
'widget' => 'text',