diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0f8558c0..aa96e451 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -57,6 +57,11 @@ jobs: allowed-to-fail: false symfony-require: 6.3.* variant: symfony/symfony:"6.3.*" + - php-version: '8.2' + dependencies: highest + allowed-to-fail: false + symfony-require: 7.0.* + variant: symfony/symfony:"7.0.*" steps: - name: Checkout diff --git a/composer.json b/composer.json index 33014d7f..01caa78f 100644 --- a/composer.json +++ b/composer.json @@ -21,20 +21,20 @@ "homepage": "https://docs.sonata-project.org/projects/form-extensions", "require": { "php": "^8.0", - "symfony/event-dispatcher": "^5.4 || ^6.2", - "symfony/form": "^5.4 || ^6.2", - "symfony/options-resolver": "^5.4 || ^6.2", - "symfony/property-access": "^5.4 || ^6.2", - "symfony/security-csrf": "^5.4 || ^6.2", - "symfony/translation": "^5.4 || ^6.2", + "symfony/event-dispatcher": "^5.4 || ^6.2 || ^7.0", + "symfony/form": "^5.4 || ^6.2 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.2 || ^7.0", + "symfony/property-access": "^5.4 || ^6.2 || ^7.0", + "symfony/security-csrf": "^5.4 || ^6.2 || ^7.0", + "symfony/translation": "^5.4 || ^6.2 || ^7.0", "symfony/translation-contracts": "^2.5 || ^3.0", - "symfony/validator": "^5.4 || ^6.2", + "symfony/validator": "^5.4 || ^6.2 || ^7.0", "twig/twig": "^3.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.4", - "matthiasnoback/symfony-config-test": "^4.2", - "matthiasnoback/symfony-dependency-injection-test": "^4.0", + "matthiasnoback/symfony-config-test": "^4.2 || ^5.1", + "matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.0", "phpstan/phpstan-phpunit": "^1.0", @@ -44,14 +44,14 @@ "psalm/plugin-phpunit": "^0.18", "psalm/plugin-symfony": "^5.0", "rector/rector": "^0.18", - "symfony/config": "^5.4 || ^6.2", - "symfony/dependency-injection": "^5.4 || ^6.2", - "symfony/framework-bundle": "^5.4 || ^6.2", - "symfony/http-foundation": "^5.4 || ^6.2", - "symfony/http-kernel": "^5.4 || ^6.2", - "symfony/phpunit-bridge": "^6.2", - "symfony/twig-bridge": "^5.4 || ^6.2", - "symfony/twig-bundle": "^5.4 || ^6.2", + "symfony/config": "^5.4 || ^6.2 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.2 || ^7.0", + "symfony/framework-bundle": "^5.4 || ^6.2 || ^7.0", + "symfony/http-foundation": "^5.4 || ^6.2 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.2 || ^7.0", + "symfony/phpunit-bridge": "^6.2 || ^7.0", + "symfony/twig-bridge": "^5.4 || ^6.2 || ^7.0", + "symfony/twig-bundle": "^5.4 || ^6.2 || ^7.0", "vimeo/psalm": "^5.8" }, "minimum-stability": "dev", diff --git a/src/Type/DateRangeType.php b/src/Type/DateRangeType.php index 5e8b2396..5bb4b30c 100644 --- a/src/Type/DateRangeType.php +++ b/src/Type/DateRangeType.php @@ -55,9 +55,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ); } - public function finishView(FormView $formView, FormInterface $form, array $options): void + public function finishView(FormView $view, FormInterface $form, array $options): void { - $formView->children['start']->vars['linked_to'] = $formView->children['end']->vars['id']; + $view->children['start']->vars['linked_to'] = $view->children['end']->vars['id']; } public function getBlockPrefix(): string diff --git a/src/Type/DateTimeRangeType.php b/src/Type/DateTimeRangeType.php index a1f51b31..9bb49f5e 100644 --- a/src/Type/DateTimeRangeType.php +++ b/src/Type/DateTimeRangeType.php @@ -55,9 +55,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ); } - public function finishView(FormView $formView, FormInterface $form, array $options): void + public function finishView(FormView $view, FormInterface $form, array $options): void { - $formView->children['start']->vars['linked_to'] = $formView->children['end']->vars['id']; + $view->children['start']->vars['linked_to'] = $view->children['end']->vars['id']; } public function getBlockPrefix(): string diff --git a/tests/Type/FormChoiceWidgetTest.php b/tests/Type/FormChoiceWidgetTest.php index f021fc6f..f10a3a00 100644 --- a/tests/Type/FormChoiceWidgetTest.php +++ b/tests/Type/FormChoiceWidgetTest.php @@ -15,6 +15,7 @@ use Sonata\Form\Test\AbstractWidgetTestCase; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\HttpKernel\Kernel; /** * @author Christian Gripp @@ -35,20 +36,35 @@ public function testLabelRendering(): void ); $html = $this->renderWidget($choice->createView()); - - static::assertStringContainsString( - $this->cleanHtmlWhitespace( - <<<'HTML' -
- - - - -
- HTML - ), - $this->cleanHtmlWhitespace($html) - ); + if (0 !== preg_match("/7\..\../", Kernel::VERSION)) { + static::assertStringContainsString( + $this->cleanHtmlWhitespace( + <<<'HTML' +
+ + + + +
+ HTML + ), + $this->cleanHtmlWhitespace($html) + ); + } else { + static::assertStringContainsString( + $this->cleanHtmlWhitespace( + <<<'HTML' +
+ + + + +
+ HTML + ), + $this->cleanHtmlWhitespace($html) + ); + } } public function testDefaultValueRendering(): void