public function AccessResultTest::testAccessForbidden in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Access/AccessResultTest.php \Drupal\Tests\Core\Access\AccessResultTest::testAccessForbidden()
@covers ::forbidden @covers ::isAllowed @covers ::isForbidden @covers ::isNeutral
File
- core/
tests/ Drupal/ Tests/ Core/ Access/ AccessResultTest.php, line 102 - Contains \Drupal\Tests\Core\Access\AccessResultTest.
Class
- AccessResultTest
- @coversDefaultClass \Drupal\Core\Access\AccessResult @group Access
Namespace
Drupal\Tests\Core\AccessCode
public function testAccessForbidden() {
$verify = function (AccessResult $access) {
$this
->assertFalse($access
->isAllowed());
$this
->assertTrue($access
->isForbidden());
$this
->assertFalse($access
->isNeutral());
$this
->assertDefaultCacheability($access);
};
// Verify the object when using the ::forbidden() convenience static method.
$b = AccessResult::forbidden();
$verify($b);
}