Skip to content

Commit

Permalink
refactor: isCLI() does not use is_cli()
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Jun 23, 2022
1 parent 388c4b5 commit c31570d
Show file tree
Hide file tree
Showing 4 changed files with 4 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 @@ -212,6 +212,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
1 change: 1 addition & 0 deletions tests/system/CommonSingleServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public static function serviceNamesProvider(): iterable
static $services = [];
static $excl = [
'__callStatic',
'createRequest',
'serviceExists',
'reset',
'resetSingle',
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 @@ -438,8 +438,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 c31570d

Please sign in to comment.