Skip to content

Commit

Permalink
Exclude the deprecated class from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ev-gor committed Nov 1, 2024
1 parent 32894f7 commit decf6f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/TokenCsrfMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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);
}
Expand Down

0 comments on commit decf6f6

Please sign in to comment.