diff --git a/src/Codeception/Module/REST.php b/src/Codeception/Module/REST.php index c7105fe..2e8d934 100644 --- a/src/Codeception/Module/REST.php +++ b/src/Codeception/Module/REST.php @@ -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; } @@ -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); } @@ -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();