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
-------
906b82eb97
Fix WeekType tests
This commit is contained in:
commit
ba1ba971d6
@ -2771,11 +2771,11 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
|
|||||||
{
|
{
|
||||||
$this->requiresFeatureSet(404);
|
$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, [
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', $data, [
|
||||||
'input' => 'array',
|
'input' => 'array',
|
||||||
'required' => false,
|
'widget' => 'choice',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
|
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
|
||||||
|
@ -2768,6 +2768,8 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
|
|||||||
|
|
||||||
public function testWeekSingleText()
|
public function testWeekSingleText()
|
||||||
{
|
{
|
||||||
|
$this->requiresFeatureSet(404);
|
||||||
|
|
||||||
$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
|
$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
|
||||||
'input' => 'string',
|
'input' => 'string',
|
||||||
'widget' => 'single_text',
|
'widget' => 'single_text',
|
||||||
@ -2785,6 +2787,8 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
|
|||||||
|
|
||||||
public function testWeekSingleTextNoHtml5()
|
public function testWeekSingleTextNoHtml5()
|
||||||
{
|
{
|
||||||
|
$this->requiresFeatureSet(404);
|
||||||
|
|
||||||
$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
|
$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
|
||||||
'input' => 'string',
|
'input' => 'string',
|
||||||
'widget' => 'single_text',
|
'widget' => 'single_text',
|
||||||
@ -2803,11 +2807,13 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
|
|||||||
|
|
||||||
public function testWeekChoices()
|
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, [
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', $data, [
|
||||||
'input' => 'array',
|
'input' => 'array',
|
||||||
'required' => false,
|
'widget' => 'choice',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
|
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
|
||||||
@ -2827,6 +2833,8 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
|
|||||||
|
|
||||||
public function testWeekText()
|
public function testWeekText()
|
||||||
{
|
{
|
||||||
|
$this->requiresFeatureSet(404);
|
||||||
|
|
||||||
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '2000-W01', [
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '2000-W01', [
|
||||||
'input' => 'string',
|
'input' => 'string',
|
||||||
'widget' => 'text',
|
'widget' => 'text',
|
||||||
|
Reference in New Issue
Block a user