createServerRequest('POST', 'http://example.com/') ->withQueryParams(['goto' => 'index.php?route=/', 'back' => 'index.php?route=/']); $response = self::createStub(ResponseInterface::class); $handler = self::createMock(RequestHandlerInterface::class); $handler->method('handle')->with($request)->willReturn($response); $urlParamsSetting = new UrlParamsSetting(self::createStub(Config::class)); self::assertSame($response, $urlParamsSetting->process($request, $handler)); /** @psalm-suppress TypeDoesNotContainType */ self::assertSame('index.php?route=/', UrlParams::$goto); /** @psalm-suppress TypeDoesNotContainType */ self::assertSame('index.php?route=/', UrlParams::$back); /** @psalm-suppress TypeDoesNotContainType */ self::assertSame(['goto' => 'index.php?route=/'], UrlParams::$params); UrlParams::$goto = ''; UrlParams::$back = ''; } }