From 546fca6bd77b4654ddfb63a8fdbea5afdd497f25 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Wed, 14 Oct 2020 20:03:03 +0200 Subject: [PATCH 1/3] Update REST.php See https://github.com/Codeception/module-rest/issues/22 --- src/Codeception/Module/REST.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Codeception/Module/REST.php b/src/Codeception/Module/REST.php index 42f87fc..95ddf14 100644 --- a/src/Codeception/Module/REST.php +++ b/src/Codeception/Module/REST.php @@ -168,7 +168,7 @@ protected function getRunningClient() } /** - * Sets a HTTP header to be used for all subsequent requests. Use [`deleteHeader`](#deleteHeader) to unset it. + * Sets a HTTP header to be used for all subsequent requests. Use [`unsetHttpHeader`](#unsetHttpHeader) to unset it. * * ```php * haveHttpHeader('X-Requested-With', 'Codeception'); * $I->sendGET('test-headers.php'); * // ... - * $I->deleteHeader('X-Requested-With'); + * $I->unsetHttpHeader('X-Requested-With'); * $I->sendPOST('some-other-page.php'); * ?> * ``` * - * @param string $name the name of the header to delete. + * @param string $name the name of the header to unset. * @part json * @part xml */ - public function deleteHeader($name) + public function unsetHttpHeader($name) { $this->connectionModule->deleteHeader($name); } + + /** + * @deprecated Use [unsetHttpHeader](#unsetHttpHeader) instead + */ + public function deleteHeader($name) + { + $this->unsetHttpHeader($name); + } /** * Checks over the given HTTP header and (optionally) From d0137a5c0195054a0a92f11126bba50e402f8ea8 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 11 Jul 2024 12:25:06 +0200 Subject: [PATCH 2/3] Update REST.php Trying to resolve the first conflict. --- src/Codeception/Module/REST.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Codeception/Module/REST.php b/src/Codeception/Module/REST.php index 95ddf14..e3f1308 100644 --- a/src/Codeception/Module/REST.php +++ b/src/Codeception/Module/REST.php @@ -197,8 +197,8 @@ public function haveHttpHeader($name, $value) * $I->haveHttpHeader('X-Requested-With', 'Codeception'); * $I->sendGET('test-headers.php'); * // ... - * $I->unsetHttpHeader('X-Requested-With'); - * $I->sendPOST('some-other-page.php'); + * $I->deleteHeader('X-Requested-With'); + * $I->sendPost('some-other-page.php'); * ?> * ``` * From 2c84bccc15bb6c9ec2ea3651a7db3405a2fc9592 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 11 Jul 2024 12:27:00 +0200 Subject: [PATCH 3/3] Update REST.php: Second conflict --- src/Codeception/Module/REST.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Codeception/Module/REST.php b/src/Codeception/Module/REST.php index e3f1308..68d335c 100644 --- a/src/Codeception/Module/REST.php +++ b/src/Codeception/Module/REST.php @@ -199,14 +199,13 @@ public function haveHttpHeader($name, $value) * // ... * $I->deleteHeader('X-Requested-With'); * $I->sendPost('some-other-page.php'); - * ?> * ``` * * @param string $name the name of the header to unset. * @part json * @part xml */ - public function unsetHttpHeader($name) + public function deleteHeader(string $name): void { $this->connectionModule->deleteHeader($name); }