function CommandLineOrUnsafeMethodTest::testIsCli
Asserts that check() returns DENY if running from the command line.
@covers ::check
      
    
File
- 
              core/tests/ Drupal/ Tests/ Core/ PageCache/ CommandLineOrUnsafeMethodTest.php, line 77 
Class
- CommandLineOrUnsafeMethodTest
- @coversDefaultClass \Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod[[api-linebreak]] @group PageCache
Namespace
Drupal\Tests\Core\PageCacheCode
public function testIsCli() : void {
  $this->policy
    ->expects($this->once())
    ->method('isCli')
    ->willReturn(TRUE);
  $request = Request::create('/', 'GET');
  $actual_result = $this->policy
    ->check($request);
  $this->assertSame(RequestPolicyInterface::DENY, $actual_result);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
