‪TYPO3CMS  10.4
Typo3StatusTest.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 ‪Typo3StatusTest extends UnitTestCase
27 {
31  protected function ‪setUp(): void
32  {
33  parent::setUp();
34  ‪$GLOBALS['LANG'] = $this->createMock(LanguageService::class);
35  }
36 
41  {
42  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'] = [];
43  $fixture = new ‪Typo3Status();
44  $result = $fixture->getStatus();
45  $statusObject = $result['registeredXclass'];
46  self::assertSame(‪Status::OK, $statusObject->getSeverity());
47  }
48 
53  {
54  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'] = [
55  'foo' => [
56  'className' => 'bar',
57  ]
58  ];
59  $fixture = new ‪Typo3Status();
60  $result = $fixture->getStatus();
61  $statusObject = $result['registeredXclass'];
62  self::assertSame(‪Status::NOTICE, $statusObject->getSeverity());
63  }
64 }
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status\Typo3StatusTest\getStatusReturnsXclassStatusObjectWithSeverityOkIfNoXclassExists
‪getStatusReturnsXclassStatusObjectWithSeverityOkIfNoXclassExists()
Definition: Typo3StatusTest.php:40
‪TYPO3\CMS\Reports\Status\NOTICE
‪const NOTICE
Definition: Status.php:25
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status\Typo3StatusTest\setUp
‪setUp()
Definition: Typo3StatusTest.php:31
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status\Typo3StatusTest
Definition: Typo3StatusTest.php:27
‪TYPO3\CMS\Reports\Status\OK
‪const OK
Definition: Status.php:27
‪TYPO3\CMS\Reports\Status
Definition: Status.php:24
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status\Typo3StatusTest\getStatusReturnsXclassStatusObjectWithSeverityNoticeIfXclassExists
‪getStatusReturnsXclassStatusObjectWithSeverityNoticeIfXclassExists()
Definition: Typo3StatusTest.php:52
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status
Definition: Typo3StatusTest.php:16
‪TYPO3\CMS\Reports\Report\Status\Typo3Status
Definition: Typo3Status.php:27
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42