Skip to content

Commit

Permalink
Merge pull request #51 from LibreSign/feature/show-response-when-get-…
Browse files Browse the repository at this point in the history
…error

Show response when get error
  • Loading branch information
vitormattos authored Mar 8, 2024
2 parents 7dbef7b + 1110ac4 commit 7230c87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/NextcloudApiContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ protected function assertStatusCode(ResponseInterface $response, int $statusCode
*/
public function theResponseShouldHaveStatusCode($code): void {
$currentCode = $this->response->getStatusCode();
Assert::assertEquals($code, $currentCode);
Assert::assertEquals($code, $currentCode, $this->response->getBody()->getContents());
}

/**
Expand All @@ -245,7 +245,8 @@ public function theResponseShouldBeAJsonArrayWithTheFollowingMandatoryValues(Tab
$this->response->getBody()->seek(0);
$expectedValues = $table->getColumnsHash();
$realResponseArray = json_decode($this->response->getBody()->getContents(), true);
Assert::assertIsArray($realResponseArray, 'The response is not a JSON array');
$this->response->getBody()->seek(0);
Assert::assertIsArray($realResponseArray, 'The response is not a JSON array: ' . $this->response->getBody()->getContents());
foreach ($expectedValues as $value) {
Assert::assertArrayHasKey(
$value['key'],
Expand Down

0 comments on commit 7230c87

Please sign in to comment.