diff --git a/.gitignore b/.gitignore index a9ad9c4..1cf4b44 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea +.phpunit.result.cache composer.phar vendor/ build/ diff --git a/Makefile b/Makefile index c5a03a2..e8b6a5b 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,6 @@ build: ; docker compose build install: ; docker compose run --rm web composer install update: ; docker compose run --rm web composer update -test: ; docker compose run --rm web ./vendor/bin/phpunit --do-not-cache-result -c phpunit.xml +test: ; docker compose run --rm web composer test test-only: ; docker compose run --rm web ./vendor/bin/phpunit --do-not-cache-result --group only -c phpunit.xml diff --git a/test/Escher/Test/EndToEnd/CentralTest.php b/test/Escher/Test/EndToEnd/CentralTest.php index cddd30f..6ac42cb 100644 --- a/test/Escher/Test/EndToEnd/CentralTest.php +++ b/test/Escher/Test/EndToEnd/CentralTest.php @@ -64,11 +64,12 @@ public function signRequestTests(JsonTestCase $testCase) $request = $testCase->getRequest(); try { + $host = $request['headers']['Host'] ?? $request['headers']['host']; $signedHeaders = $escher->signRequest( $testCase->getApiKey(), $testCase->getApiSecret(), $request['method'], - 'https://' . $request['headers']['Host'] . $request['url'], + 'https://' . $host . $request['url'], $request['body'], $request['headers'], $testCase->getHeadersToSign(), diff --git a/test/Escher/Test/Helper/JsonTestCase.php b/test/Escher/Test/Helper/JsonTestCase.php index fb07553..0103ab8 100644 --- a/test/Escher/Test/Helper/JsonTestCase.php +++ b/test/Escher/Test/Helper/JsonTestCase.php @@ -135,7 +135,7 @@ public function getExpectedError(): string public function getMandatorySignedHeaders() { - return $this->data['mandatorySignedHeaders'] ?: []; + return $this->data['mandatorySignedHeaders'] ?? []; } public function getAlgoPrefix(): string @@ -155,12 +155,12 @@ public function getHashAlgo(): string public function getAuthHeaderName(): ?string { - return $this->data['config']['authHeaderName']; + return $this->data['config']['authHeaderName'] ?? null; } public function getDateHeaderName(): ?string { - return $this->data['config']['dateHeaderName']; + return $this->data['config']['dateHeaderName'] ?? null; } public function getApiKey(): string @@ -170,7 +170,7 @@ public function getApiKey(): string public function getApiSecret(): ?string { - return $this->data['config']['apiSecret']; + return $this->data['config']['apiSecret'] ?? null; } public function getKeyDb(): array