‪TYPO3CMS  10.4
ApplicationTypeTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 
26 class ‪ApplicationTypeTest extends UnitTestCase
27 {
32  {
33  $this->expectException(\RuntimeException::class);
34  $this->expectExceptionCode(1606222812);
36  }
37 
42  {
43  self::assertTrue(
45  ->isFrontend()
46  );
47  }
48 
53  {
54  self::assertFalse(
56  ->isFrontend()
57  );
58  }
59 
64  {
65  self::assertTrue(
67  ->isBackend()
68  );
69  }
70 
75  {
76  self::assertFalse(
78  ->isBackend()
79  );
80  }
81 }
‪TYPO3\CMS\Core\Http\ApplicationType\fromRequest
‪static static fromRequest(ServerRequestInterface $request)
Definition: ApplicationType.php:64
‪TYPO3\CMS\Core\Tests\Unit\Http
Definition: ApplicationTypeTest.php:16
‪TYPO3\CMS\Core\Core\SystemEnvironmentBuilder
Definition: SystemEnvironmentBuilder.php:42
‪TYPO3\CMS\Core\Tests\Unit\Http\ApplicationTypeTest\isBackendReturnsTrueIfNotBackend
‪isBackendReturnsTrueIfNotBackend()
Definition: ApplicationTypeTest.php:74
‪TYPO3\CMS\Core\Core\SystemEnvironmentBuilder\REQUESTTYPE_BE
‪const REQUESTTYPE_BE
Definition: SystemEnvironmentBuilder.php:46
‪TYPO3\CMS\Core\Tests\Unit\Http\ApplicationTypeTest\isFrontendReturnsFalseIfNotFrontend
‪isFrontendReturnsFalseIfNotFrontend()
Definition: ApplicationTypeTest.php:52
‪TYPO3\CMS\Core\Http\ApplicationType
Definition: ApplicationType.php:52
‪TYPO3\CMS\Core\Tests\Unit\Http\ApplicationTypeTest
Definition: ApplicationTypeTest.php:27
‪TYPO3\CMS\Core\Tests\Unit\Http\ApplicationTypeTest\fromRequestThrowsIfTypeIsMissing
‪fromRequestThrowsIfTypeIsMissing()
Definition: ApplicationTypeTest.php:31
‪TYPO3\CMS\Core\Http\ServerRequest
Definition: ServerRequest.php:37
‪TYPO3\CMS\Core\Tests\Unit\Http\ApplicationTypeTest\isBackendReturnsTrueIfBackend
‪isBackendReturnsTrueIfBackend()
Definition: ApplicationTypeTest.php:63
‪TYPO3\CMS\Core\Tests\Unit\Http\ApplicationTypeTest\isFrontendReturnsTrueIfFrontend
‪isFrontendReturnsTrueIfFrontend()
Definition: ApplicationTypeTest.php:41
‪TYPO3\CMS\Core\Core\SystemEnvironmentBuilder\REQUESTTYPE_FE
‪const REQUESTTYPE_FE
Definition: SystemEnvironmentBuilder.php:44