Skip to content

Commit

Permalink
Update Protected Endpoints tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan Pichat committed Feb 15, 2024
1 parent 7622942 commit 73842e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions tests/Integration/ApiPlatform/CustomerGroupApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ public function testProtectedEndpoints(string $method, string $uri): void
self::assertResponseStatusCodeSame(401);

$content = $response->getContent(false);
$this->assertNotEmpty($content);
$decodedContent = json_decode($content, true);
$this->assertArrayHasKey('title', $decodedContent);
$this->assertArrayHasKey('detail', $decodedContent);
$this->assertStringContainsString('An error occurred', $decodedContent['title']);
$this->assertStringContainsString('Full authentication is required to access this resource.', $decodedContent['detail']);
$this->assertEmpty($content);
}

public function getProtectedEndpoints(): iterable
Expand Down
7 changes: 1 addition & 6 deletions tests/Integration/ApiPlatform/ProductEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,7 @@ public function testProtectedEndpoints(string $method, string $uri, string $cont
self::assertResponseStatusCodeSame(401);

$content = $response->getContent(false);
$this->assertNotEmpty($content);
$decodedContent = json_decode($content, true);
$this->assertArrayHasKey('title', $decodedContent);
$this->assertArrayHasKey('detail', $decodedContent);
$this->assertStringContainsString('An error occurred', $decodedContent['title']);
$this->assertStringContainsString('Full authentication is required to access this resource.', $decodedContent['detail']);
$this->assertEmpty($content);
}

public function getProtectedEndpoints(): iterable
Expand Down

0 comments on commit 73842e3

Please sign in to comment.