Skip to content

Commit

Permalink
Rector
Browse files Browse the repository at this point in the history
  • Loading branch information
chalasr committed Mar 24, 2024
1 parent 2a02eb5 commit aa4b204
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testOnAuthenticationFailure()
$content = json_decode($response->getContent(), true);

$this->assertInstanceOf(JsonResponse::class, $response);
$this->assertSame(Response::HTTP_UNAUTHORIZED, $response->getStatusCode());
$this->assertSame(Response::HTTP_UNAUTHORIZED, $response->getStatusCode(), $response->getContent());
$this->assertSame(401, $content['code']);
$this->assertSame($authenticationException->getMessageKey(), $content['message']);
}
Expand All @@ -52,7 +52,7 @@ public function testOnAuthenticationFailureWithANonDefaultHttpFailureStatusCode(
$content = json_decode($response->getContent(), true);

$this->assertInstanceOf(JsonResponse::class, $response);
$this->assertSame(Response::HTTP_FORBIDDEN, $response->getStatusCode());
$this->assertSame(Response::HTTP_FORBIDDEN, $response->getStatusCode(), $response->getContent());
$this->assertSame(403, $content['code']);
$this->assertSame($authenticationException->getMessageKey(), $content['message']);
}
Expand All @@ -75,7 +75,7 @@ public function testOnAuthenticationFailureWithANonHttpStatusCode($nonHttpStatus
$content = json_decode($response->getContent(), true);

$this->assertInstanceOf(JsonResponse::class, $response);
$this->assertSame(Response::HTTP_UNAUTHORIZED, $response->getStatusCode());
$this->assertSame(Response::HTTP_UNAUTHORIZED, $response->getStatusCode(), $response->getContent());
$this->assertSame(401, $content['code']);
$this->assertSame($authenticationException->getMessageKey(), $content['message']);
}
Expand All @@ -96,7 +96,7 @@ public function testOnAuthenticationFailureWithTranslator()
$content = json_decode($response->getContent(), true);

$this->assertInstanceOf(JsonResponse::class, $response);
$this->assertSame(Response::HTTP_UNAUTHORIZED, $response->getStatusCode());
$this->assertSame(Response::HTTP_UNAUTHORIZED, $response->getStatusCode(), $response->getContent());
$this->assertSame(401, $content['code']);
$this->assertSame('translated message', $content['message']);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function testOnAuthenticationSuccess()
->onAuthenticationSuccess($request, $token);

$this->assertInstanceOf(JsonResponse::class, $response);
$this->assertSame(Response::HTTP_OK, $response->getStatusCode());
$this->assertSame(Response::HTTP_OK, $response->getStatusCode(), $response->getContent());

$content = json_decode($response->getContent(), true);
$this->assertArrayHasKey('token', $content);
Expand All @@ -49,7 +49,7 @@ public function testHandleAuthenticationSuccess()
->handleAuthenticationSuccess($this->getUser());

$this->assertInstanceOf(JsonResponse::class, $response);
$this->assertSame(Response::HTTP_OK, $response->getStatusCode());
$this->assertSame(Response::HTTP_OK, $response->getStatusCode(), $response->getContent());

$content = json_decode($response->getContent(), true);
$this->assertArrayHasKey('token', $content);
Expand All @@ -62,7 +62,7 @@ public function testHandleAuthenticationSuccessWithGivenJWT()
->handleAuthenticationSuccess($this->getUser(), 'jwt');

$this->assertInstanceOf(JsonResponse::class, $response);
$this->assertSame(Response::HTTP_OK, $response->getStatusCode());
$this->assertSame(Response::HTTP_OK, $response->getStatusCode(), $response->getContent());

$content = json_decode($response->getContent(), true);
$this->assertArrayHasKey('token', $content);
Expand Down

0 comments on commit aa4b204

Please sign in to comment.