‪TYPO3CMS  ‪main
Typo3StatusTest.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 
20 use PHPUnit\Framework\Attributes\Test;
24 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
25 
26 final class ‪Typo3StatusTest extends UnitTestCase
27 {
28  protected function ‪setUp(): void
29  {
30  parent::setUp();
31  $mockLanguageService = $this->getMockBuilder(LanguageService::class)->disableOriginalConstructor()->getMock();
32  ‪$GLOBALS['LANG'] = $mockLanguageService;
33  }
34 
35  #[Test]
37  {
38  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'] = [];
39  $fixture = new ‪Typo3Status();
40  $result = $fixture->getStatus();
41  $statusObject = $result['registeredXclass'];
42  self::assertSame(ContextualFeedbackSeverity::OK, $statusObject->getSeverity());
43  }
44 
45  #[Test]
47  {
48  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'] = [
49  'foo' => [
50  'className' => 'bar',
51  ],
52  ];
53  $fixture = new ‪Typo3Status();
54  $result = $fixture->getStatus();
55  $statusObject = $result['registeredXclass'];
56  self::assertSame(ContextualFeedbackSeverity::NOTICE, $statusObject->getSeverity());
57  }
58 }
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status\Typo3StatusTest\getStatusReturnsXclassStatusObjectWithSeverityOkIfNoXclassExists
‪getStatusReturnsXclassStatusObjectWithSeverityOkIfNoXclassExists()
Definition: Typo3StatusTest.php:36
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status\Typo3StatusTest\setUp
‪setUp()
Definition: Typo3StatusTest.php:28
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status\Typo3StatusTest
Definition: Typo3StatusTest.php:27
‪TYPO3\CMS\Core\Type\ContextualFeedbackSeverity
‪ContextualFeedbackSeverity
Definition: ContextualFeedbackSeverity.php:25
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status\Typo3StatusTest\getStatusReturnsXclassStatusObjectWithSeverityNoticeIfXclassExists
‪getStatusReturnsXclassStatusObjectWithSeverityNoticeIfXclassExists()
Definition: Typo3StatusTest.php:46
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status
Definition: StatusTest.php:18
‪TYPO3\CMS\Reports\Report\Status\Typo3Status
Definition: Typo3Status.php:29
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:46