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