‪TYPO3CMS  11.5
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 Prophecy\Argument;
21 use Prophecy\PhpUnit\ProphecyTrait;
25 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
26 
30 class ‪Typo3StatusTest extends UnitTestCase
31 {
32  use ProphecyTrait;
33 
37  protected function ‪setUp(): void
38  {
39  parent::setUp();
40  $languageServiceProphecy = $this->prophesize(LanguageService::class);
41  $languageServiceProphecy->getLL(Argument::any())->willReturn('');
42  ‪$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
43  }
44 
49  {
50  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'] = [];
51  $fixture = new ‪Typo3Status();
52  $result = $fixture->getStatus();
53  $statusObject = $result['registeredXclass'];
54  self::assertSame(‪Status::OK, $statusObject->getSeverity());
55  }
56 
61  {
62  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'] = [
63  'foo' => [
64  'className' => 'bar',
65  ],
66  ];
67  $fixture = new ‪Typo3Status();
68  $result = $fixture->getStatus();
69  $statusObject = $result['registeredXclass'];
70  self::assertSame(‪Status::NOTICE, $statusObject->getSeverity());
71  }
72 }
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status\Typo3StatusTest\getStatusReturnsXclassStatusObjectWithSeverityOkIfNoXclassExists
‪getStatusReturnsXclassStatusObjectWithSeverityOkIfNoXclassExists()
Definition: Typo3StatusTest.php:47
‪TYPO3\CMS\Reports\Status\NOTICE
‪const NOTICE
Definition: Status.php:25
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status\Typo3StatusTest\setUp
‪setUp()
Definition: Typo3StatusTest.php:36
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status\Typo3StatusTest
Definition: Typo3StatusTest.php:31
‪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:59
‪TYPO3\CMS\Reports\Tests\Unit\Report\Status
Definition: Typo3StatusTest.php:18
‪TYPO3\CMS\Reports\Report\Status\Typo3Status
Definition: Typo3Status.php:27
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42