diff --git a/tests/Unit/Debug/Provider/DebugApiProviderTest.php b/tests/Unit/Debug/Provider/DebugApiProviderTest.php index 7b99d1a..1d26116 100644 --- a/tests/Unit/Debug/Provider/DebugApiProviderTest.php +++ b/tests/Unit/Debug/Provider/DebugApiProviderTest.php @@ -7,6 +7,7 @@ use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Yiisoft\Router\RouteCollectorInterface; +use Yiisoft\Yii\Debug\Api\Debug\Http\RouteCollectorWrapper; use Yiisoft\Yii\Debug\Api\Debug\Middleware\DebugHeaders; use Yiisoft\Yii\Debug\Api\Debug\Provider\DebugApiProvider; @@ -26,11 +27,18 @@ public function testExtension(): void $routeCollectorDecorator = $extensions[RouteCollectorInterface::class]; $this->assertIsCallable($routeCollectorDecorator); + $middlewares = [DebugHeaders::class]; + $container = $this->createMock(ContainerInterface::class); + $container->expects($this->once()) + ->method('get') + ->with(RouteCollectorWrapper::class) + ->willReturn(new RouteCollectorWrapper($middlewares)); + $routeCollector = $this->createMock(RouteCollectorInterface::class); $routeCollector->expects($this->once()) ->method('prependMiddleware') - ->with(DebugHeaders::class) + ->with(...$middlewares) ->willReturn($routeCollector); $this->assertSame($routeCollector, $routeCollectorDecorator($container, $routeCollector));