From fdc3827c4e76773a1c673cf32305a5b4bf957d5b Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Mon, 19 Feb 2024 03:01:27 +0100 Subject: [PATCH] bump routing --- composer.json | 7 +++--- phpunit.xml.dist | 23 ++++++++----------- src/Doctrine/Orm/RedirectRoute.php | 9 ++------ tests/Fixtures/App/Kernel.php | 4 ++-- .../Doctrine/Orm/RedirectRouteTest.php | 9 ++------ 5 files changed, 19 insertions(+), 33 deletions(-) diff --git a/composer.json b/composer.json index 737a71b5..bcca8930 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ ], "require": { "php": "^8.1", - "symfony-cmf/routing": "^3.0", + "symfony-cmf/routing": "^3.0.3", "symfony/framework-bundle": "^6.4 || ^7.0" }, "require-dev": { @@ -36,7 +36,7 @@ "symfony/translation": "^6.4 || ^7.0", "symfony/validator": "^6.4 || ^7.0", "symfony/twig-bundle": "^6.4 || ^7.0", - "symfony-cmf/testing": "dev-sf7 as 4.2.0", + "symfony-cmf/testing": "dev-fix-test-kernel as 5.0.2", "twig/twig": "^2.4.4 || ^3.0" }, "suggest": { @@ -69,6 +69,5 @@ "allow-plugins": { "composer/package-versions-deprecated": true } - }, - "minimum-stability": "dev" + } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f40ee5f1..8f6f0ec5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,36 +1,33 @@ - - - ./tests/Unit - ./tests/Functional ./tests/Functional/Doctrine/Orm - ./tests/Functional/Doctrine/Orm - - + + src/ - - Resources/ - - - + + + src/Resources/ + + - + diff --git a/src/Doctrine/Orm/RedirectRoute.php b/src/Doctrine/Orm/RedirectRoute.php index 5bc160d6..3bb5f210 100644 --- a/src/Doctrine/Orm/RedirectRoute.php +++ b/src/Doctrine/Orm/RedirectRoute.php @@ -17,16 +17,11 @@ * {@inheritdoc} * * Provides a redirect route stored in the Doctrine ORM and used as content for generic route to provide redirects + * + * @property int $id */ class RedirectRoute extends RedirectRouteModel { - /** - * Unique id of this route. - * - * @var int - */ - protected $id; - protected string $serialisedParameters; /** diff --git a/tests/Fixtures/App/Kernel.php b/tests/Fixtures/App/Kernel.php index 101fd36e..8dbc25a2 100644 --- a/tests/Fixtures/App/Kernel.php +++ b/tests/Fixtures/App/Kernel.php @@ -17,7 +17,7 @@ class Kernel extends TestKernel { - public function configure() + public function configure(): void { $this->requireBundleSet('default'); @@ -39,7 +39,7 @@ public function configure() } } - public function registerContainerConfiguration(LoaderInterface $loader) + public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(__DIR__.'/config/config_'.$this->environment.'.php'); } diff --git a/tests/Functional/Doctrine/Orm/RedirectRouteTest.php b/tests/Functional/Doctrine/Orm/RedirectRouteTest.php index a46b65ac..1e938f68 100644 --- a/tests/Functional/Doctrine/Orm/RedirectRouteTest.php +++ b/tests/Functional/Doctrine/Orm/RedirectRouteTest.php @@ -14,13 +14,10 @@ use Symfony\Cmf\Bundle\RoutingBundle\Controller\RedirectController; use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm\RedirectRoute; use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm\Route; -use Symfony\Component\HttpFoundation\RedirectResponse; class RedirectRouteTest extends OrmTestCase { - private $repository; - - private $controller; + private RedirectController $controller; public function setUp(): void { @@ -28,11 +25,10 @@ public function setUp(): void $this->clearDb(Route::class); $this->clearDb(RedirectRoute::class); - $this->repository = $this->getContainer()->get('cmf_routing.route_provider'); $this->controller = new RedirectController($this->getContainer()->get('router')); } - public function testRedirectDoctrine() + public function testRedirectDoctrine(): void { $route = $this->createRoute('route1', '/test'); @@ -52,7 +48,6 @@ public function testRedirectDoctrine() $response = $this->controller->redirectAction($redirectRoute->getContent()); - $this->assertInstanceOf(RedirectResponse::class, $response); $this->assertSame(301, $response->getStatusCode()); $this->assertSame('http://localhost/test', $response->getTargetUrl()); }