public function AccessResultForbiddenTest::testSetReason in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Access/AccessResultForbiddenTest.php \Drupal\Tests\Core\Access\AccessResultForbiddenTest::testSetReason()
- 9 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);
}