Skip to content

Commit

Permalink
Merge pull request #5653 from kenjis/refactor-CLI-Incomming-Request
Browse files Browse the repository at this point in the history
refactor: isCLI() in CLIRequest and IncomingRequest
  • Loading branch information
samsonasik authored Feb 16, 2022
2 parents 048d997 + 873ba16 commit 93b8bca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion system/HTTP/CLIRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,6 @@ protected function parseCommand()
*/
public function isCLI(): bool
{
return is_cli();
return true;
}
}
2 changes: 1 addition & 1 deletion system/HTTP/IncomingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public function negotiate(string $type, array $supported, bool $strictMatch = fa
*/
public function isCLI(): bool
{
return is_cli();
return false;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions tests/system/HTTP/IncomingRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,7 @@ public function testCanGrabGetRawInput()

public function testIsCLI()
{
// this should be the case in unit testing
$this->assertTrue($this->request->isCLI());
$this->assertFalse($this->request->isCLI());
}

public function testIsAJAX()
Expand Down

0 comments on commit 93b8bca

Please sign in to comment.