From decf6f62d1dfff009dbcc59aeda8df9c4a4aa0e8 Mon Sep 17 00:00:00 2001 From: Eugen Gorbunov Date: Fri, 1 Nov 2024 19:24:17 +0400 Subject: [PATCH] Exclude the deprecated class from tests --- tests/TokenCsrfMiddlewareTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/TokenCsrfMiddlewareTest.php b/tests/TokenCsrfMiddlewareTest.php index b355f8c..fa4224b 100644 --- a/tests/TokenCsrfMiddlewareTest.php +++ b/tests/TokenCsrfMiddlewareTest.php @@ -11,7 +11,7 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; -use Yiisoft\Csrf\CsrfMiddleware; +use Yiisoft\Csrf\CsrfTokenMiddleware; use Yiisoft\Csrf\CsrfTokenInterface; use Yiisoft\Csrf\MaskedCsrfToken; use Yiisoft\Http\Method; @@ -156,7 +156,7 @@ private function createDeleteServerRequestWithBodyToken(string $token): ServerRe private function createPostServerRequestWithHeaderToken( string $token, - string $headerName = CsrfMiddleware::HEADER_NAME + string $headerName = CsrfTokenMiddleware::HEADER_NAME ): ServerRequestInterface { return $this->createServerRequest(Method::POST, [], [ $headerName => $token, @@ -183,11 +183,11 @@ private function getBodyRequestParamsByToken(string $token): array protected function createCsrfMiddleware( ?CsrfTokenInterface $csrfToken = null, RequestHandlerInterface $failureHandler = null - ): CsrfMiddleware { + ): CsrfTokenMiddleware { $csrfToken = new MaskedCsrfToken($csrfToken ?? $this->createCsrfToken()); $this->token = $csrfToken->getValue(); - $middleware = new CsrfMiddleware(new Psr17Factory(), $csrfToken, $failureHandler); + $middleware = new CsrfTokenMiddleware(new Psr17Factory(), $csrfToken, $failureHandler); return $middleware->withParameterName(self::PARAM_NAME); }