‪TYPO3CMS  11.5
VisibilityAspectTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
23 
24 class ‪VisibilityAspectTest extends UnitTestCase
25 {
29  public function ‪getterReturnsProperDefaultValues(): void
30  {
31  $subject = new ‪VisibilityAspect();
32  self::assertFalse($subject->includeHiddenPages());
33  self::assertFalse($subject->includeHiddenContent());
34  self::assertFalse($subject->includeDeletedRecords());
35  }
36 
40  public function ‪getterReturnsProperValues(): void
41  {
42  $subject = new ‪VisibilityAspect(true, true, true);
43  self::assertTrue($subject->includeHiddenPages());
44  self::assertTrue($subject->includeHiddenContent());
45  self::assertTrue($subject->includeDeletedRecords());
46  }
47 
51  public function ‪getReturnsProperValues(): void
52  {
53  $subject = new ‪VisibilityAspect(true, true, true);
54  self::assertTrue($subject->get('includeHiddenPages'));
55  self::assertTrue($subject->get('includeHiddenContent'));
56  self::assertTrue($subject->get('includeDeletedRecords'));
57  }
58 
63  {
64  $this->expectException(AspectPropertyNotFoundException::class);
65  $this->expectExceptionCode(1527780439);
66  $subject = new ‪VisibilityAspect();
67  $subject->get('football');
68  }
69 }
‪TYPO3\CMS\Core\Context\VisibilityAspect
Definition: VisibilityAspect.php:31
‪TYPO3\CMS\Core\Tests\Unit\Context\VisibilityAspectTest
Definition: VisibilityAspectTest.php:25
‪TYPO3\CMS\Core\Tests\Unit\Context\VisibilityAspectTest\getterReturnsProperValues
‪getterReturnsProperValues()
Definition: VisibilityAspectTest.php:40
‪TYPO3\CMS\Core\Tests\Unit\Context\VisibilityAspectTest\getThrowsExceptionOnInvalidArgument
‪getThrowsExceptionOnInvalidArgument()
Definition: VisibilityAspectTest.php:62
‪TYPO3\CMS\Core\Tests\Unit\Context\VisibilityAspectTest\getterReturnsProperDefaultValues
‪getterReturnsProperDefaultValues()
Definition: VisibilityAspectTest.php:29
‪TYPO3\CMS\Core\Tests\Unit\Context\VisibilityAspectTest\getReturnsProperValues
‪getReturnsProperValues()
Definition: VisibilityAspectTest.php:51
‪TYPO3\CMS\Core\Context\Exception\AspectPropertyNotFoundException
Definition: AspectPropertyNotFoundException.php:25
‪TYPO3\CMS\Core\Tests\Unit\Context
Definition: ContextTest.php:18