diff --git a/composer.json b/composer.json index d398216..91ef197 100644 --- a/composer.json +++ b/composer.json @@ -13,14 +13,14 @@ "require": { "php": "^8.4", "psr/container": "^2.0", - "symfony/console": "^7.3", - "symfony/filesystem": "^6|^7" + "symfony/console": "^7.3 || ^8", + "symfony/filesystem": "^6 || ^7 || ^8" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.87", "phpstan/phpstan": "^2.1", - "phpunit/phpunit": "^12.3", - "symfony/process": "^7.3" + "phpunit/phpunit": "^13.0", + "symfony/process": "^7.3 || ^8" }, "autoload": { "psr-4": { diff --git a/tests/Unit/Router/Compiler/RouteCompilerVisitorTest.php b/tests/Unit/Router/Compiler/RouteCompilerVisitorTest.php index aa83cfc..f123595 100644 --- a/tests/Unit/Router/Compiler/RouteCompilerVisitorTest.php +++ b/tests/Unit/Router/Compiler/RouteCompilerVisitorTest.php @@ -22,13 +22,13 @@ class RouteCompilerVisitorTest extends TestCase { - private Stub&ServiceLocator $serviceLocator; + private MockObject&ServiceLocator $serviceLocator; private MockObject&EventDispatcher $dispatcher; private RouteCompilerVisitor $visitor; public function setUp(): void { - $this->serviceLocator = $this->createStub(ServiceLocator::class); + $this->serviceLocator = $this->createMock(ServiceLocator::class); $this->dispatcher = $this->createMock(EventDispatcher::class); $this->visitor = new RouteCompilerVisitor('/base', $this->serviceLocator, $this->dispatcher); } @@ -39,6 +39,10 @@ public function testVisitRoute(string $path, string $expectedPath, string $expec $controller = static fn() => 'OK'; $route = new Route($path, $controller, 'example_name', ['a' => 1]); + $this->serviceLocator + ->expects($this->never()) + ->method('get'); + $expected = new CompiledRoute( $expectedPath, $expectedDist, @@ -69,6 +73,10 @@ public function testVisitAsset(): void { $asset = new Asset('/images/logo.png', '/src/assets/logo.png', 'logo'); + $this->serviceLocator + ->expects($this->never()) + ->method('get'); + $expected = new CompiledRoute( '/base/images/logo.png', '/base/images/logo.png', @@ -96,6 +104,10 @@ public function testVisitGroupWithIterable(): void new Asset('/assets/style.css', '/src/style.css', 'style'), ]); + $this->serviceLocator + ->expects($this->never()) + ->method('get'); + $expectedRoute = new CompiledRoute( '/base/blog/post', '/base/blog/post/index.html', @@ -151,6 +163,10 @@ public function routes(): iterable } }; + $this->serviceLocator + ->expects($this->never()) + ->method('get'); + $expected1 = new CompiledRoute( '/base/group/a', '/base/group/a/index.html', @@ -208,7 +224,11 @@ public function routes(): iterable }; $reference = 'provider_reference'; - $this->serviceLocator->method('get')->with($reference)->willReturn($provider); + $this->serviceLocator + ->expects($this->once()) + ->method('get') + ->with($reference) + ->willReturn($provider); $expected1 = new CompiledRoute( '/base/group/a',