Security update for Core, with self-updated composer
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Access / AccessResultNeutralTest.php
1 <?php
2
3 namespace Drupal\Tests\Core\Access;
4
5 use Drupal\Core\Access\AccessResultNeutral;
6 use Drupal\Tests\UnitTestCase;
7
8 /**
9  * @coversDefaultClass \Drupal\Core\Access\AccessResultNeutral
10  * @group Access
11  */
12 class AccessResultNeutralTest extends UnitTestCase {
13
14   /**
15    * Tests the construction of an AccessResultForbidden object.
16    *
17    * @covers ::__construct
18    * @covers ::getReason
19    */
20   public function testConstruction() {
21     $a = new AccessResultNeutral();
22     $this->assertNull($a->getReason());
23
24     $reason = $this->getRandomGenerator()->string();
25     $b = new AccessResultNeutral($reason);
26     $this->assertEquals($reason, $b->getReason());
27   }
28
29   /**
30    * Test setReason()
31    *
32    * @covers ::setReason
33    */
34   public function testSetReason() {
35     $a = new AccessResultNeutral();
36
37     $reason = $this->getRandomGenerator()->string();
38     $return = $a->setReason($reason);
39
40     $this->assertSame($reason, $a->getReason());
41     $this->assertSame($a, $return);
42   }
43
44 }