function AccessResultNeutralTest::testConstruction
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php \Drupal\Tests\Core\Access\AccessResultNeutralTest::testConstruction()
- 8.9.x core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php \Drupal\Tests\Core\Access\AccessResultNeutralTest::testConstruction()
- 11.x core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php \Drupal\Tests\Core\Access\AccessResultNeutralTest::testConstruction()
Tests the construction of an AccessResultForbidden object.
@covers ::__construct @covers ::getReason
File
-
core/
tests/ Drupal/ Tests/ Core/ Access/ AccessResultNeutralTest.php, line 22
Class
- AccessResultNeutralTest
- @coversDefaultClass \Drupal\Core\Access\AccessResultNeutral @group Access
Namespace
Drupal\Tests\Core\AccessCode
public function testConstruction() : void {
$a = new AccessResultNeutral();
$this->assertEquals('', $a->getReason());
$reason = $this->getRandomGenerator()
->string();
$b = new AccessResultNeutral($reason);
$this->assertEquals($reason, $b->getReason());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.