From 0a4fbb72336dae6c1ee033853fd5c5ed9ecef122 Mon Sep 17 00:00:00 2001 From: Dave Long Date: Mon, 17 Jan 2022 10:49:15 +0000 Subject: [PATCH] Symfony 6 and PHPUnit 9. --- composer.json | 8 ++++---- phpunit.xml.dist | 3 --- src/Stack/StackedHttpKernel.php | 2 +- tests/bootstrap.php | 2 +- tests/functional/ApplicationTest.php | 3 ++- tests/unit/Stack/BuilderTest.php | 2 +- tests/unit/Stack/StackedHttpKernelTest.php | 2 +- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 84b435a..f9a766e 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,12 @@ ], "require": { "php": ">=7.2.0", - "symfony/http-foundation": "~2.1|~3.0|~4.0|~5.0", - "symfony/http-kernel": "~2.1|~3.0|~4.0|~5.0" + "symfony/http-foundation": "~2.1|~3.0|~4.0|~5.0|~6.0", + "symfony/http-kernel": "~2.1|~3.0|~4.0|~5.0|~6.0" }, "require-dev": { - "phpunit/phpunit": "~8.0", - "symfony/routing": "^5.0" + "phpunit/phpunit": "~9.0", + "symfony/routing": "^6.0" }, "scripts": { "test": "phpunit --coverage-text" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 58f6414..b1ac8d6 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -11,9 +11,6 @@ ./tests/unit/ - - ./tests/integration/ - ./tests/functional/ diff --git a/src/Stack/StackedHttpKernel.php b/src/Stack/StackedHttpKernel.php index f89a4db..2925dec 100644 --- a/src/Stack/StackedHttpKernel.php +++ b/src/Stack/StackedHttpKernel.php @@ -18,7 +18,7 @@ public function __construct(HttpKernelInterface $app, array $middlewares) $this->middlewares = $middlewares; } - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) + public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true): Response { return $this->app->handle($request, $type, $catch); } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index b7ccedd..7b462e2 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -44,7 +44,7 @@ public function __construct() $this->kernel = new HttpKernel($this->dispatcher, $controllerResolver, new RequestStack(), $argumentResolver); } - public function handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true) + public function handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true): Response { return $this->kernel->handle($request); } diff --git a/tests/functional/ApplicationTest.php b/tests/functional/ApplicationTest.php index 82c6ae9..61181f9 100644 --- a/tests/functional/ApplicationTest.php +++ b/tests/functional/ApplicationTest.php @@ -6,6 +6,7 @@ use PHPUnit\Framework\TestCase; use Stack\Builder; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\HttpKernelInterface; class ApplicationTest extends TestCase @@ -45,7 +46,7 @@ public function __construct(HttpKernelInterface $app, $appendix) $this->appendix = $appendix; } - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) + public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true): Response { $response = clone $this->app->handle($request, $type, $catch); $response->setContent($response->getContent().$this->appendix); diff --git a/tests/unit/Stack/BuilderTest.php b/tests/unit/Stack/BuilderTest.php index a48487d..0a5e733 100644 --- a/tests/unit/Stack/BuilderTest.php +++ b/tests/unit/Stack/BuilderTest.php @@ -193,7 +193,7 @@ public function __construct(HttpKernelInterface $app, $appendix) $this->appendix = $appendix; } - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) + public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true): Response { $response = clone $this->app->handle($request, $type, $catch); $response->setContent($response->getContent().$this->appendix); diff --git a/tests/unit/Stack/StackedHttpKernelTest.php b/tests/unit/Stack/StackedHttpKernelTest.php index aadb053..ab0c901 100644 --- a/tests/unit/Stack/StackedHttpKernelTest.php +++ b/tests/unit/Stack/StackedHttpKernelTest.php @@ -119,7 +119,7 @@ public function __construct(HttpKernelInterface $kernel = null) $this->kernel = $kernel; } - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) + public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true): Response { $this->handleCallCount++;