‪TYPO3CMS  9.5
WorkspaceAspectTest.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 ‪WorkspaceAspectTest extends UnitTestCase
23 {
28  {
29  $subject = new ‪WorkspaceAspect();
30  $this->assertTrue($subject->isLive());
31  $this->assertEquals(0, $subject->getId());
32  $this->assertEquals(0, $subject->get('id'));
33  $this->assertTrue($subject->get('isLive'));
34  $this->assertFalse($subject->get('isOffline'));
35  }
36 
41  {
42  $subject = new ‪WorkspaceAspect(13);
43  $this->assertEquals(13, $subject->getId());
44  $this->assertEquals(13, $subject->get('id'));
45  $this->assertFalse($subject->isLive());
46  $this->assertFalse($subject->get('isLive'));
47  $this->assertTrue($subject->get('isOffline'));
48  }
49 
54  {
55  $this->expectException(AspectPropertyNotFoundException::class);
56  $this->expectExceptionCode(1527779447);
57  $subject = new ‪WorkspaceAspect();
58  $subject->get('football');
59  }
60 }
‪TYPO3\CMS\Core\Context\WorkspaceAspect
Definition: WorkspaceAspect.php:29
‪TYPO3\CMS\Core\Tests\Unit\Context\WorkspaceAspectTest\getterReturnsProperCustomValues
‪getterReturnsProperCustomValues()
Definition: WorkspaceAspectTest.php:40
‪TYPO3\CMS\Core\Tests\Unit\Context\WorkspaceAspectTest
Definition: WorkspaceAspectTest.php:23
‪TYPO3\CMS\Core\Tests\Unit\Context\WorkspaceAspectTest\getterReturnsProperDefaultValues
‪getterReturnsProperDefaultValues()
Definition: WorkspaceAspectTest.php:27
‪TYPO3\CMS\Core\Tests\Unit\Context\WorkspaceAspectTest\getThrowsExceptionOnInvalidArgument
‪getThrowsExceptionOnInvalidArgument()
Definition: WorkspaceAspectTest.php:53
‪TYPO3\CMS\Core\Context\Exception\AspectPropertyNotFoundException
Definition: AspectPropertyNotFoundException.php:24
‪TYPO3\CMS\Core\Tests\Unit\Context
Definition: ContextTest.php:3