From d38d4b798c0c5241533e87e839785b983feda3e5 Mon Sep 17 00:00:00 2001 From: orbeji Date: Wed, 17 Jan 2024 22:16:25 +0100 Subject: [PATCH] fix test symfony 6.4 --- composer.json | 79 ++++++++++++++------------- tests/Helper/RouteUsageHelperTest.php | 4 +- 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/composer.json b/composer.json index 04270c6..f3f483a 100644 --- a/composer.json +++ b/composer.json @@ -1,42 +1,43 @@ { - "name": "orbeji/unused-routes", - "description": "", - "license": "MIT", - "type": "symfony-bundle", - "require": { - "php": ">=8.1", - "symfony/console": "^6.4 || ^7.0", - "symfony/framework-bundle": "^6.4 || ^7.0", - "webmozart/assert": "^1.11" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.41", - "nyholm/symfony-bundle-test": "^3.0", - "phpstan/extension-installer": "^1.3", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-symfony": "^1.3", - "phpunit/phpunit": "^10.5.5", - "rregeer/phpunit-coverage-check": "^0.3.1", - "squizlabs/php_codesniffer": "^3.8", - "symfony/phpunit-bridge": "^7.0.1" - }, - "minimum-stability": "stable", - "autoload": { - "psr-4": { - "Orbeji\\UnusedRoutes\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Orbeji\\UnusedRoutes\\Tests\\": "tests/" - } - }, - "config": { - "allow-plugins": { - "ergebnis/composer-normalize": true, - "phpstan/extension-installer": true, - "yceruto/bundle-flex": true - }, - "sort-packages": true + "name": "orbeji/unused-routes", + "description": "", + "license": "MIT", + "type": "symfony-bundle", + "require": { + "php": ">=8.1", + "symfony/console": "^6.4 || ^7.0", + "symfony/flex": "^2.4", + "symfony/framework-bundle": "^6.4 || ^7.0", + "webmozart/assert": "^1.11" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.41", + "nyholm/symfony-bundle-test": "^3.0", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-symfony": "^1.3", + "phpunit/phpunit": "^10.5.5", + "rregeer/phpunit-coverage-check": "^0.3.1", + "squizlabs/php_codesniffer": "^3.8", + "symfony/phpunit-bridge": "^7.0.1" + }, + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Orbeji\\UnusedRoutes\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Orbeji\\UnusedRoutes\\Tests\\": "tests/" } + }, + "config": { + "allow-plugins": { + "ergebnis/composer-normalize": true, + "phpstan/extension-installer": true, + "symfony/flex": true + }, + "sort-packages": true + } } diff --git a/tests/Helper/RouteUsageHelperTest.php b/tests/Helper/RouteUsageHelperTest.php index 79cd387..86d5534 100644 --- a/tests/Helper/RouteUsageHelperTest.php +++ b/tests/Helper/RouteUsageHelperTest.php @@ -14,9 +14,11 @@ class RouteUsageHelperTest extends TestCase { public function testEmpty(): void { + $router = $this->createStub(RouterInterface::class); + $router->method('getRouteCollection')->willReturn(new RouteCollection()); $routeUsageHelper = new RouteUsageHelper( $this->createStub(UsageRouteProviderInterface::class), - $this->createStub(RouterInterface::class) + $router ); $result = $routeUsageHelper->getRoutesUsage(false);