Skip to content

Commit

Permalink
Merge pull request #78 from drossha/2.0
Browse files Browse the repository at this point in the history
Don't pass null to isBinaryData
  • Loading branch information
Naktibalda committed Mar 30, 2022
2 parents 0f4f48b + 034e45f commit 9cbba12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Codeception/Module/REST.php
Expand Up @@ -180,7 +180,7 @@ public function _inject(InnerBrowser $connection)

public function _failed(TestInterface $test, $fail)
{
if ($this->response === '' || $this->response === '0') {
if ($this->response === null || $this->response === '' || $this->response === '0') {
return;
}

Expand Down Expand Up @@ -706,7 +706,7 @@ protected function execute($method, $url, $parameters = [], $files = [])
}

$printedResponse = $this->response;
if ($this->isBinaryData((string) $printedResponse)) {
if ($this->isBinaryData((string)$printedResponse)) {
$printedResponse = $this->binaryToDebugString($printedResponse);
}

Expand Down Expand Up @@ -1000,7 +1000,7 @@ public function seeResponseIsValidOnJsonSchema(string $schemaFilename): void
* @param string $jsonString the json encoded string
* @param string $errorFormat optional string for custom sprintf format
*/
protected function decodeAndValidateJson(string $jsonString, string $errorFormat="Invalid json: %s. System message: %s.")
protected function decodeAndValidateJson(string $jsonString, string $errorFormat = "Invalid json: %s. System message: %s.")
{
$json = json_decode($jsonString);
$errorCode = json_last_error();
Expand Down

0 comments on commit 9cbba12

Please sign in to comment.