Skip to content

Commit 2b21087

Browse files
authored
Merge pull request #86 from Codeception/fix-return-type-of-grabHttpHeader
Fix return type of grabHttpHeader method
2 parents b46823e + 2c7adb8 commit 2b21087

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Codeception/Module/REST.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public function seeHttpHeaderOnce(string $name): void
310310
* @part json
311311
* @part xml
312312
*/
313-
public function grabHttpHeader(string $name, bool $first = true): string|array
313+
public function grabHttpHeader(string $name, bool $first = true): string|array|null
314314
{
315315
return $this->getRunningClient()->getInternalResponse()->getHeader($name, $first);
316316
}

tests/unit/Codeception/Module/RestTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ public function testSeeHeaders()
384384
$this->assertSame('en-US', $this->module->grabHttpHeader('Content-Language'));
385385
$this->assertSame('no-cache', $this->module->grabHttpHeader('Cache-Control'));
386386
$this->assertSame(['no-cache', 'no-store'], $this->module->grabHttpHeader('Cache-Control', false));
387+
$this->assertSame(null, $this->module->grabHttpHeader('Foo-Bar'));
387388
}
388389

389390
public function testSeeHeadersOnce()

0 commit comments

Comments
 (0)