From 4219d16c3685a2895313d1baa742523b6e0571f4 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Sat, 28 Sep 2024 13:16:28 +0200 Subject: [PATCH] [TwigBridge] Remove `VersionAwareTest` from `AbstractLayoutTestCase` --- .../AbstractBootstrap3LayoutTestCase.php | 8 ---- .../AbstractBootstrap5LayoutTestCase.php | 2 - .../Extension/AbstractLayoutTestCase.php | 37 ------------------- .../Form/Test/FormPerformanceTestCase.php | 1 - .../Extension/Core/Type/BaseTypeTestCase.php | 18 --------- 5 files changed, 66 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTestCase.php b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTestCase.php index 08a026fe7d114..a25bd54281e22 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTestCase.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTestCase.php @@ -2869,8 +2869,6 @@ public function testColor() 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', @@ -2889,8 +2887,6 @@ public function testWeekSingleText() 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', @@ -2910,8 +2906,6 @@ public function testWeekSingleTextNoHtml5() public function testWeekChoices() { - $this->requiresFeatureSet(404); - $data = ['year' => (int) date('Y'), 'week' => 1]; $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', $data, [ @@ -2938,8 +2932,6 @@ public function testWeekChoices() public function testWeekText() { - $this->requiresFeatureSet(404); - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '2000-W01', [ 'input' => 'string', 'widget' => 'text', diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap5LayoutTestCase.php b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap5LayoutTestCase.php index 576f2b18f66fc..4b3aa7fa5eb3e 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap5LayoutTestCase.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap5LayoutTestCase.php @@ -1842,8 +1842,6 @@ public function testTimezoneWithPlaceholder() public function testWeekChoices() { - $this->requiresFeatureSet(404); - $data = ['year' => (int) date('Y'), 'week' => 1]; $form = $this->factory->createNamed('name', WeekType::class, $data, [ diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php index f340b066ed884..4c620213c78aa 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php @@ -18,7 +18,6 @@ use Symfony\Component\Form\Extension\Csrf\CsrfExtension; use Symfony\Component\Form\FormError; use Symfony\Component\Form\FormView; -use Symfony\Component\Form\Tests\VersionAwareTest; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; use Symfony\Component\Translation\TranslatableMessage; use Symfony\Contracts\Translation\TranslatableInterface; @@ -26,8 +25,6 @@ abstract class AbstractLayoutTestCase extends FormLayoutTestCase { - use VersionAwareTest; - protected MockObject&CsrfTokenManagerInterface $csrfTokenManager; protected array $testableFeatures = []; @@ -672,8 +669,6 @@ public function testSingleExpandedChoiceAttributesWithMainAttributes() public function testSingleChoiceWithPreferred() { - $this->requiresFeatureSet(404); - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'preferred_choices' => ['&b'], @@ -698,8 +693,6 @@ public function testSingleChoiceWithPreferred() public function testSingleChoiceWithPreferredAndNoSeparator() { - $this->requiresFeatureSet(404); - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'preferred_choices' => ['&b'], @@ -723,8 +716,6 @@ public function testSingleChoiceWithPreferredAndNoSeparator() public function testSingleChoiceWithPreferredAndBlankSeparator() { - $this->requiresFeatureSet(404); - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'preferred_choices' => ['&b'], @@ -749,8 +740,6 @@ public function testSingleChoiceWithPreferredAndBlankSeparator() public function testChoiceWithOnlyPreferred() { - $this->requiresFeatureSet(404); - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [ 'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'], 'preferred_choices' => ['&a', '&b'], @@ -1814,8 +1803,6 @@ public function testNumber() public function testRenderNumberWithHtml5NumberType() { - $this->requiresFeatureSet(403); - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\NumberType', 1234.56, [ 'html5' => true, ]); @@ -1832,8 +1819,6 @@ public function testRenderNumberWithHtml5NumberType() public function testRenderNumberWithHtml5NumberTypeAndStepAttribute() { - $this->requiresFeatureSet(403); - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\NumberType', 1234.56, [ 'html5' => true, 'attr' => ['step' => '0.1'], @@ -1908,8 +1893,6 @@ public function testPercent() public function testPercentNoSymbol() { - $this->requiresFeatureSet(403); - $form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => false, 'rounding_mode' => \NumberFormatter::ROUND_CEILING]); $this->assertWidgetMatchesXpath($form->createView(), [], '/input @@ -1923,8 +1906,6 @@ public function testPercentNoSymbol() public function testPercentCustomSymbol() { - $this->requiresFeatureSet(403); - $form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => '‱', 'rounding_mode' => \NumberFormatter::ROUND_CEILING]); $this->assertWidgetMatchesXpath($form->createView(), [], '/input @@ -2602,8 +2583,6 @@ public function testColor() public function testLabelWithTranslationParameters() { - $this->requiresFeatureSet(403); - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); $html = $this->renderLabel($form->createView(), 'Address is %address%', [ 'label_translation_parameters' => [ @@ -2621,8 +2600,6 @@ public function testLabelWithTranslationParameters() public function testHelpWithTranslationParameters() { - $this->requiresFeatureSet(403); - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [ 'help' => 'for company %company%', 'help_translation_parameters' => [ @@ -2693,8 +2670,6 @@ public function trans(TranslatorInterface $translator, ?string $locale = null): public function testAttributesWithTranslationParameters() { - $this->requiresFeatureSet(403); - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [ 'attr' => [ 'title' => 'Message to %company%', @@ -2716,8 +2691,6 @@ public function testAttributesWithTranslationParameters() public function testButtonWithTranslationParameters() { - $this->requiresFeatureSet(403); - $form = $this->factory->createNamedBuilder('myform') ->add('mybutton', 'Symfony\Component\Form\Extension\Core\Type\ButtonType', [ 'label' => 'Submit to %company%', @@ -2741,8 +2714,6 @@ public function testButtonWithTranslationParameters() */ public function testSubmitFormNoValidate(bool $validate) { - $this->requiresFeatureSet(404); - $form = $this->factory->create(SubmitType::class, null, [ 'validate' => $validate, ]); @@ -2772,8 +2743,6 @@ public static function submitFormNoValidateProvider() 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', @@ -2791,8 +2760,6 @@ public function testWeekSingleText() 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', @@ -2811,8 +2778,6 @@ public function testWeekSingleTextNoHtml5() public function testWeekChoices() { - $this->requiresFeatureSet(404); - $data = ['year' => (int) date('Y'), 'week' => 1]; $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', $data, [ @@ -2837,8 +2802,6 @@ public function testWeekChoices() public function testWeekText() { - $this->requiresFeatureSet(404); - $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '2000-W01', [ 'input' => 'string', 'widget' => 'text', diff --git a/src/Symfony/Component/Form/Test/FormPerformanceTestCase.php b/src/Symfony/Component/Form/Test/FormPerformanceTestCase.php index 3c6ba1145ad35..702f37b7a4d57 100644 --- a/src/Symfony/Component/Form/Test/FormPerformanceTestCase.php +++ b/src/Symfony/Component/Form/Test/FormPerformanceTestCase.php @@ -25,7 +25,6 @@ abstract class FormPerformanceTestCase extends FormIntegrationTestCase { use RunTestTrait; - use VersionAwareTest; /** * @var int diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTestCase.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTestCase.php index 5238e2fd88098..32ab611168e47 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTestCase.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTestCase.php @@ -19,8 +19,6 @@ */ abstract class BaseTypeTestCase extends TypeTestCase { - use VersionAwareTest; - public const TESTED_TYPE = ''; public function testPassDisabledAsOption() @@ -114,8 +112,6 @@ public function testDefaultTranslationDomain() public function testPassLabelTranslationParametersToView() { - $this->requiresFeatureSet(403); - $view = $this->factory->create($this->getTestedType(), null, array_merge($this->getTestOptions(), [ 'label_translation_parameters' => ['%param%' => 'value'], ])) @@ -126,8 +122,6 @@ public function testPassLabelTranslationParametersToView() public function testPassAttrTranslationParametersToView() { - $this->requiresFeatureSet(403); - $view = $this->factory->create($this->getTestedType(), null, array_merge($this->getTestOptions(), [ 'attr_translation_parameters' => ['%param%' => 'value'], ])) @@ -138,8 +132,6 @@ public function testPassAttrTranslationParametersToView() public function testInheritLabelTranslationParametersFromParent() { - $this->requiresFeatureSet(403); - $view = $this->factory ->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, [ 'label_translation_parameters' => ['%param%' => 'value'], @@ -153,8 +145,6 @@ public function testInheritLabelTranslationParametersFromParent() public function testInheritAttrTranslationParametersFromParent() { - $this->requiresFeatureSet(403); - $view = $this->factory ->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, [ 'attr_translation_parameters' => ['%param%' => 'value'], @@ -168,8 +158,6 @@ public function testInheritAttrTranslationParametersFromParent() public function testPreferOwnLabelTranslationParameters() { - $this->requiresFeatureSet(403); - $view = $this->factory ->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, [ 'label_translation_parameters' => ['%parent_param%' => 'parent_value', '%override_param%' => 'parent_override_value'], @@ -185,8 +173,6 @@ public function testPreferOwnLabelTranslationParameters() public function testPreferOwnAttrTranslationParameters() { - $this->requiresFeatureSet(403); - $view = $this->factory ->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, [ 'attr_translation_parameters' => ['%parent_param%' => 'parent_value', '%override_param%' => 'parent_override_value'], @@ -202,8 +188,6 @@ public function testPreferOwnAttrTranslationParameters() public function testDefaultLabelTranslationParameters() { - $this->requiresFeatureSet(403); - $view = $this->factory->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE) ->add('child', $this->getTestedType(), $this->getTestOptions()) ->getForm() @@ -214,8 +198,6 @@ public function testDefaultLabelTranslationParameters() public function testDefaultAttrTranslationParameters() { - $this->requiresFeatureSet(403); - $view = $this->factory->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE) ->add('child', $this->getTestedType(), $this->getTestOptions()) ->getForm()