diff --git a/src/Sylius/Bundle/AdminBundle/composer.json b/src/Sylius/Bundle/AdminBundle/composer.json index 122be847f1fd..527dc8486cb1 100644 --- a/src/Sylius/Bundle/AdminBundle/composer.json +++ b/src/Sylius/Bundle/AdminBundle/composer.json @@ -45,7 +45,7 @@ "twig/twig": "~3.8.0" }, "require-dev": { - "matthiasnoback/symfony-dependency-injection-test": "^4.2", + "matthiasnoback/symfony-dependency-injection-test": "^5.1", "php-http/message-factory": "^1.0", "phpspec/phpspec": "^7.2", "phpspec/prophecy-phpunit": "^2.0", @@ -61,6 +61,9 @@ "extra": { "branch-alias": { "dev-main": "2.0-dev" + }, + "symfony": { + "require": "7.0.*" } }, "autoload": { diff --git a/src/Sylius/Bundle/AdminBundle/spec/Action/Account/RequestPasswordResetActionSpec.php b/src/Sylius/Bundle/AdminBundle/spec/Action/Account/RequestPasswordResetActionSpec.php index ffe2af1c78b1..dfc267d3b093 100644 --- a/src/Sylius/Bundle/AdminBundle/spec/Action/Account/RequestPasswordResetActionSpec.php +++ b/src/Sylius/Bundle/AdminBundle/spec/Action/Account/RequestPasswordResetActionSpec.php @@ -18,10 +18,10 @@ use Sylius\Bundle\AdminBundle\Form\Model\PasswordResetRequest; use Sylius\Bundle\AdminBundle\Form\RequestPasswordResetType; use Sylius\Bundle\CoreBundle\Command\Admin\Account\RequestResetPasswordEmail; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; +use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; @@ -57,7 +57,7 @@ public function it_sends_reset_password_request_to_message_bus( RouterInterface $router, FormInterface $form, Request $request, - ParameterBagInterface $attributesBag, + ParameterBag $attributesBag, ): void { $formFactory ->create(RequestPasswordResetType::class) @@ -100,7 +100,7 @@ public function it_is_able_to_send_reset_password_request_when_sylius_redirect_p RouterInterface $router, FormInterface $form, Request $request, - ParameterBagInterface $attributesBag, + ParameterBag $attributesBag, ): void { $formFactory->create(RequestPasswordResetType::class)->willReturn($form); @@ -142,7 +142,7 @@ public function it_redirects_to_default_route_if_custom_one_is_not_defined( RouterInterface $router, FormInterface $form, Request $request, - ParameterBagInterface $attributesBag, + ParameterBag $attributesBag, ): void { $formFactory->create(RequestPasswordResetType::class)->willReturn($form); diff --git a/src/Sylius/Bundle/AdminBundle/spec/EventListener/AdminFilterSubscriberSpec.php b/src/Sylius/Bundle/AdminBundle/spec/EventListener/AdminFilterSubscriberSpec.php index e151760f8ad7..8e31b69c87a0 100644 --- a/src/Sylius/Bundle/AdminBundle/spec/EventListener/AdminFilterSubscriberSpec.php +++ b/src/Sylius/Bundle/AdminBundle/spec/EventListener/AdminFilterSubscriberSpec.php @@ -16,6 +16,7 @@ use PhpSpec\ObjectBehavior; use Prophecy\Argument; use Sylius\Bundle\UiBundle\Storage\FilterStorageInterface; +use Symfony\Component\HttpFoundation\InputBag; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\RequestEvent; @@ -37,7 +38,6 @@ function it_adds_filter_to_filter_storage( RequestEvent $event, Request $request, ParameterBag $attributes, - ParameterBag $query, FilterStorageInterface $filterStorage, ): void { $event->isMainRequest()->willReturn(true); @@ -48,7 +48,7 @@ function it_adds_filter_to_filter_storage( $attributes->get('_controller')->willReturn('Sylius\Bundle\AdminBundle\Controller\ProductController::indexAction'); $request->attributes = $attributes; - $query->all()->willReturn(['filter' => 'foo']); + $query = new InputBag(['filter' => 'foo']); $request->query = $query; $filterStorage->all()->willReturn([]); @@ -76,7 +76,6 @@ function it_does_not_add_filter_to_filter_storage_if_request_format_is_not_html( RequestEvent $event, Request $request, ParameterBag $attributes, - ParameterBag $query, FilterStorageInterface $filterStorage, ): void { $event->isMainRequest()->willReturn(true); @@ -87,7 +86,7 @@ function it_does_not_add_filter_to_filter_storage_if_request_format_is_not_html( $attributes->get('_controller')->willReturn('Sylius\Bundle\AdminBundle\Controller\ProductController::indexAction'); $request->attributes = $attributes; - $query->all()->willReturn(['filter' => 'foo']); + $query = new InputBag(['filter' => 'foo']); $request->query = $query; $filterStorage->all()->willReturn([]); @@ -103,7 +102,6 @@ function it_does_not_add_filter_to_filter_storage_if_it_is_not_an_admin_section( RequestEvent $event, Request $request, ParameterBag $attributes, - ParameterBag $query, FilterStorageInterface $filterStorage, ): void { $event->isMainRequest()->willReturn(true); @@ -114,7 +112,7 @@ function it_does_not_add_filter_to_filter_storage_if_it_is_not_an_admin_section( $attributes->get('_controller')->willReturn('Sylius\Bundle\AdminBundle\Controller\ProductController::indexAction'); $request->attributes = $attributes; - $query->all()->willReturn(['filter' => 'foo']); + $query = new InputBag(['filter' => 'foo']); $request->query = $query; $filterStorage->all()->willReturn([]); @@ -130,7 +128,6 @@ function it_does_not_add_filter_to_filter_storage_if_controller_is_null( RequestEvent $event, Request $request, ParameterBag $attributes, - ParameterBag $query, FilterStorageInterface $filterStorage, ): void { $event->isMainRequest()->willReturn(true); @@ -141,7 +138,7 @@ function it_does_not_add_filter_to_filter_storage_if_controller_is_null( $attributes->get('_controller')->willReturn(null); $request->attributes = $attributes; - $query->all()->willReturn(['filter' => 'foo']); + $query = new InputBag(['filter' => 'foo']); $request->query = $query; $filterStorage->all()->willReturn([]); @@ -157,7 +154,6 @@ function it_does_not_add_filter_to_filter_storage_if_route_is_missing( RequestEvent $event, Request $request, ParameterBag $attributes, - ParameterBag $query, FilterStorageInterface $filterStorage, ): void { $event->isMainRequest()->willReturn(true); @@ -168,7 +164,7 @@ function it_does_not_add_filter_to_filter_storage_if_route_is_missing( $attributes->get('_controller')->willReturn('Sylius\Bundle\AdminBundle\Controller\ProductController::indexAction'); $request->attributes = $attributes; - $query->all()->willReturn(['filter' => 'foo']); + $query = new InputBag(['filter' => 'foo']); $request->query = $query; $filterStorage->all()->willReturn([]); @@ -184,7 +180,6 @@ function it_does_not_add_filter_to_filter_storage_if_it_is_not_a_index_resource_ RequestEvent $event, Request $request, ParameterBag $attributes, - ParameterBag $query, FilterStorageInterface $filterStorage, ): void { $event->isMainRequest()->willReturn(true); @@ -195,7 +190,7 @@ function it_does_not_add_filter_to_filter_storage_if_it_is_not_a_index_resource_ $attributes->get('_controller')->willReturn('Sylius\Bundle\AdminBundle\Controller\ProductController::indexAction'); $request->attributes = $attributes; - $query->all()->willReturn(['filter' => 'foo']); + $query = new InputBag(['filter' => 'foo']); $request->query = $query; $filterStorage->all()->willReturn([]); diff --git a/src/Sylius/Bundle/AdminBundle/spec/EventListener/AdminSectionCacheControlSubscriberSpec.php b/src/Sylius/Bundle/AdminBundle/spec/EventListener/AdminSectionCacheControlSubscriberSpec.php index 9c8b29db47d2..7c71a0a7b001 100644 --- a/src/Sylius/Bundle/AdminBundle/spec/EventListener/AdminSectionCacheControlSubscriberSpec.php +++ b/src/Sylius/Bundle/AdminBundle/spec/EventListener/AdminSectionCacheControlSubscriberSpec.php @@ -52,7 +52,7 @@ function it_adds_cache_control_directives_to_admin_requests( $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - KernelInterface::MASTER_REQUEST, + KernelInterface::MAIN_REQUEST, $response->getWrappedObject(), ); @@ -79,7 +79,7 @@ function it_does_nothing_if_section_is_different_than_admin( $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - KernelInterface::MASTER_REQUEST, + KernelInterface::MAIN_REQUEST, $response->getWrappedObject(), );