8000 minor #34245 Fix WeekType tests (fancyweb) · symfony/symfony@ba1ba97 · GitHub
[go: up one dir, main page]

Skip to content

Commit ba1ba97

Browse files
committed
minor #34245 Fix WeekType tests (fancyweb)
This PR was merged into the 4.4 branch. Discussion ---------- Fix WeekType tests | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - `WeekToArrayTransformer::reverseTransform()` requires an integer + `testWeekChoices()` widget arg was forgotten. Commits ------- 906b82e Fix WeekType tests
2 parents a307733 + 906b82e commit ba1ba97

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2771,11 +2771,11 @@ public function testWeekChoices()
27712771
{
27722772
$this->requiresFeatureSet(404);
27732773

2774-
$data = ['year' => date('Y'), 'week' => 1];
2774+
$data = ['year' => (int) date('Y'), 'week' => 1];
27752775

27762776
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', $data, [
27772777
'input' => 'array',
2778-
'required' => false,
2778+
'widget' => 'choice',
27792779
]);
27802780

27812781
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],

src/Symfony/Component/Form/Tests/AbstractLayoutTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,6 +2768,8 @@ public function submitFormNoValidateProvider()
27682768

27692769
public function testWeekSingleText()
27702770
{
2771+
$this->requiresFeatureSet(404);
2772+
27712773
$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
27722774
'input' => 'string',
27732775
'widget' => 'single_text',
@@ -2785,6 +2787,8 @@ public function testWeekSingleText()
27852787

27862788
public function testWeekSingleTextNoHtml5()
27872789
{
2790+
$this->requiresFeatureSet(404);
2791+
27882792
$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
27892793
'input' => 'string',
27902794
'widget' => 'single_text',
@@ -2803,11 +2807,13 @@ public function testWeekSingleTextNoHtml5()
28032807

28042808
public function testWeekChoices()
28052809
{
2806-
$data = ['year' => date('Y'), 'week' => 1];
2810+
$this->requiresFeatureSet(404);
2811+
2812+
$data = ['year' => (int) date('Y'), 'week' => 1];
28072813

28082814
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', $data, [
28092815
'input' => 'array',
2810-
'required' => false,
2816+
'widget' => 'choice',
28112817
]);
28122818

28132819
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
@@ -2827,6 +2833,8 @@ public function testWeekChoices()
28272833

28282834
public function testWeekText()
28292835
{
2836+
$this->requiresFeatureSet(404);
2837+
28302838
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '2000-W01', [
28312839
'input' => 'string',
28322840
'widget' => 'text',

0 commit comments

Comments
 (0)
0