public function AccessResultNeutralTest::testConstruction in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php \Drupal\Tests\Core\Access\AccessResultNeutralTest::testConstruction()
- 9 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 20
Class
- AccessResultNeutralTest
- @coversDefaultClass \Drupal\Core\Access\AccessResultNeutral @group Access
Namespace
Drupal\Tests\Core\AccessCode
public function testConstruction() {
$a = new AccessResultNeutral();
$this
->assertEquals('', $a
->getReason());
$reason = $this
->getRandomGenerator()
->string();
$b = new AccessResultNeutral($reason);
$this
->assertEquals($reason, $b
->getReason());
}