‪TYPO3CMS  9.5
VisibilityAspectTest.php
Go to the documentation of this file.
1 <?php
2 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 
20 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
21 
22 class ‪VisibilityAspectTest extends UnitTestCase
23 {
28  {
29  $subject = new ‪VisibilityAspect();
30  $this->assertFalse($subject->includeHiddenPages());
31  $this->assertFalse($subject->includeHiddenContent());
32  $this->assertFalse($subject->includeDeletedRecords());
33  }
34 
38  public function ‪getterReturnsProperValues()
39  {
40  $subject = new ‪VisibilityAspect(true, true, true);
41  $this->assertTrue($subject->includeHiddenPages());
42  $this->assertTrue($subject->includeHiddenContent());
43  $this->assertTrue($subject->includeDeletedRecords());
44  }
45 
49  public function ‪getReturnsProperValues()
50  {
51  $subject = new ‪VisibilityAspect(true, true, true);
52  $this->assertTrue($subject->get('includeHiddenPages'));
53  $this->assertTrue($subject->get('includeHiddenContent'));
54  $this->assertTrue($subject->get('includeDeletedRecords'));
55  }
56 
61  {
62  $this->expectException(AspectPropertyNotFoundException::class);
63  $this->expectExceptionCode(1527780439);
64  $subject = new ‪VisibilityAspect();
65  $subject->get('football');
66  }
67 }
‪TYPO3\CMS\Core\Context\VisibilityAspect
Definition: VisibilityAspect.php:29
‪TYPO3\CMS\Core\Tests\Unit\Context\VisibilityAspectTest
Definition: VisibilityAspectTest.php:23
‪TYPO3\CMS\Core\Tests\Unit\Context\VisibilityAspectTest\getterReturnsProperValues
‪getterReturnsProperValues()
Definition: VisibilityAspectTest.php:38
‪TYPO3\CMS\Core\Tests\Unit\Context\VisibilityAspectTest\getThrowsExceptionOnInvalidArgument
‪getThrowsExceptionOnInvalidArgument()
Definition: VisibilityAspectTest.php:60
‪TYPO3\CMS\Core\Tests\Unit\Context\VisibilityAspectTest\getterReturnsProperDefaultValues
‪getterReturnsProperDefaultValues()
Definition: VisibilityAspectTest.php:27
‪TYPO3\CMS\Core\Tests\Unit\Context\VisibilityAspectTest\getReturnsProperValues
‪getReturnsProperValues()
Definition: VisibilityAspectTest.php:49
‪TYPO3\CMS\Core\Context\Exception\AspectPropertyNotFoundException
Definition: AspectPropertyNotFoundException.php:24
‪TYPO3\CMS\Core\Tests\Unit\Context
Definition: ContextTest.php:3