diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2015c21..d76c53d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,9 @@ jobs: tests: runs-on: ubuntu-latest + env: + COMPOSER_ROOT_VERSION: 2.99.99 + strategy: matrix: php: [7.4, 8.0] diff --git a/composer.json b/composer.json index ae682ed..11a0c19 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "ext-json": "*", "codeception/codeception": "^4.1", "justinrainbow/json-schema": "~5.2.9", - "softcreatr/jsonpath": "^0.5 | ^0.7" + "softcreatr/jsonpath": "^0.5 | ^0.7 | ^0.8" }, "require-dev": { "codeception/stub": "^4.0", 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();