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 16, 2024
1 parent 7622942 commit 260de99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions tests/Integration/ApiPlatform/CustomerGroupApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ public function testProtectedEndpoints(string $method, string $uri): void

$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->assertEquals('No Authorization header provided', $content);
}

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

$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->assertEquals('No Authorization header provided', $content);
}

public function getProtectedEndpoints(): iterable
Expand Down

0 comments on commit 260de99

Please sign in to comment.