public function AccessResultNeutralTest::testSetReason in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php \Drupal\Tests\Core\Access\AccessResultNeutralTest::testSetReason()
- 9 core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php \Drupal\Tests\Core\Access\AccessResultNeutralTest::testSetReason()
Tests setReason()
@covers ::setReason
File
- core/
tests/ Drupal/ Tests/ Core/ Access/ AccessResultNeutralTest.php, line 34
Class
- AccessResultNeutralTest
- @coversDefaultClass \Drupal\Core\Access\AccessResultNeutral @group Access
Namespace
Drupal\Tests\Core\AccessCode
public function testSetReason() {
$a = new AccessResultNeutral();
$reason = $this
->getRandomGenerator()
->string();
$return = $a
->setReason($reason);
$this
->assertSame($reason, $a
->getReason());
$this
->assertSame($a, $return);
}