Skip to content

Commit ee7624b

Browse files
committed
add test for force_https() null request and response will create on the inside function
1 parent a37a56d commit ee7624b

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

system/Common.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,9 @@ function force_https(int $duration = 31536000, RequestInterface $request = null,
402402

403403
if (ENVIRONMENT !== 'testing' && (is_cli() || $request->isSecure()))
404404
{
405+
// @codeCoverageIgnoreStart
405406
return;
407+
// @codeCoverageIgnoreEnd
406408
}
407409

408410
// If the session status is active, we should regenerate

tests/system/CommonFunctionsTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,4 +440,11 @@ public function testViewNotSaveData()
440440
$this->assertStringContainsString('<h1>is_not</h1>', view('\Tests\Support\View\Views\simples'));
441441
}
442442

443+
//--------------------------------------------------------------------
444+
445+
public function testForceHttpsNullRequestAndResponse()
446+
{
447+
$this->assertNull(force_https());
448+
}
449+
443450
}

0 commit comments

Comments
 (0)