function AccessResultForbiddenTest::testSetReason
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Access/AccessResultForbiddenTest.php \Drupal\Tests\Core\Access\AccessResultForbiddenTest::testSetReason()
- 10 core/tests/Drupal/Tests/Core/Access/AccessResultForbiddenTest.php \Drupal\Tests\Core\Access\AccessResultForbiddenTest::testSetReason()
- 11.x core/tests/Drupal/Tests/Core/Access/AccessResultForbiddenTest.php \Drupal\Tests\Core\Access\AccessResultForbiddenTest::testSetReason()
Tests setReason()
@covers ::setReason
File
-
core/
tests/ Drupal/ Tests/ Core/ Access/ AccessResultForbiddenTest.php, line 35
Class
- AccessResultForbiddenTest
- @coversDefaultClass \Drupal\Core\Access\AccessResultForbidden @group Access
Namespace
Drupal\Tests\Core\AccessCode
public function testSetReason() {
$a = new AccessResultForbidden();
$reason = $this->getRandomGenerator()
->string();
$return = $a->setReason($reason);
$this->assertSame($reason, $a->getReason());
$this->assertSame($a, $return);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.