Skip to content

Commit 086762e

Browse files
Update REST.php (#106)
See #22 Co-authored-by: Thomas Landauer <[email protected]>
1 parent 311c2ba commit 086762e

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/Codeception/Module/REST.php

+13-5
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ protected function getRunningClient(): AbstractBrowser
201201
}
202202

203203
/**
204-
* Sets a HTTP header to be used for all subsequent requests. Use [`deleteHeader`](#deleteHeader) to unset it.
204+
* Sets a HTTP header to be used for all subsequent requests. Use [`unsetHttpHeader`](#unsetHttpHeader) to unset it.
205205
*
206206
* ```php
207207
* <?php
@@ -218,7 +218,7 @@ public function haveHttpHeader(string $name, string $value): void
218218
}
219219

220220
/**
221-
* Deletes a HTTP header (that was originally added by [haveHttpHeader()](#haveHttpHeader)),
221+
* Unsets a HTTP header (that was originally added by [haveHttpHeader()](#haveHttpHeader)),
222222
* so that subsequent requests will not send it anymore.
223223
*
224224
* Example:
@@ -227,18 +227,26 @@ public function haveHttpHeader(string $name, string $value): void
227227
* $I->haveHttpHeader('X-Requested-With', 'Codeception');
228228
* $I->sendGet('test-headers.php');
229229
* // ...
230-
* $I->deleteHeader('X-Requested-With');
230+
* $I->unsetHttpHeader('X-Requested-With');
231231
* $I->sendPost('some-other-page.php');
232232
* ```
233233
*
234-
* @param string $name the name of the header to delete.
234+
* @param string $name the name of the header to unset.
235235
* @part json
236236
* @part xml
237237
*/
238-
public function deleteHeader(string $name): void
238+
public function unsetHttpHeader(string $name): void
239239
{
240240
$this->connectionModule->deleteHeader($name);
241241
}
242+
243+
/**
244+
* @deprecated Use [unsetHttpHeader](#unsetHttpHeader) instead
245+
*/
246+
public function deleteHeader(string $name): void
247+
{
248+
$this->unsetHttpHeader($name);
249+
}
242250

243251
/**
244252
* Checks over the given HTTP header and (optionally)

0 commit comments

Comments
 (0)