‪TYPO3CMS  10.4
CoreUpdateServiceTest.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 
20 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
21 
25 class ‪CoreUpdateServiceTest extends UnitTestCase
26 {
31  {
33  $instance = $this->getAccessibleMock(CoreUpdateService::class, ['dummy'], [], '', false);
34  $aMessage = new ‪FlashMessageQueue('install');
35  $instance->_set('messages', $aMessage);
36  self::assertSame($aMessage, $instance->getMessages());
37  }
38 
43  {
44  if (defined('TYPO3_COMPOSER_MODE') && TYPO3_COMPOSER_MODE) {
45  self::markTestSkipped('This test is only available in Non-Composer mode.');
46  }
48  $instance = $this->getAccessibleMock(CoreUpdateService::class, ['dummy'], [], '', false);
49  putenv('TYPO3_DISABLE_CORE_UPDATER');
50  putenv('REDIRECT_TYPO3_DISABLE_CORE_UPDATER');
51  self::assertTrue($instance->isCoreUpdateEnabled());
52  }
53 
58  {
60  $instance = $this->getAccessibleMock(CoreUpdateService::class, ['dummy'], [], '', false);
61  putenv('TYPO3_DISABLE_CORE_UPDATER=1');
62  putenv('REDIRECT_TYPO3_DISABLE_CORE_UPDATER');
63  self::assertFalse($instance->isCoreUpdateEnabled());
64  }
65 
70  {
72  $instance = $this->getAccessibleMock(CoreUpdateService::class, ['dummy'], [], '', false);
73  putenv('TYPO3_DISABLE_CORE_UPDATER');
74  putenv('REDIRECT_TYPO3_DISABLE_CORE_UPDATER=1');
75  self::assertFalse($instance->isCoreUpdateEnabled());
76  }
77 }
‪TYPO3\CMS\Install\Tests\Unit\Service\CoreUpdateServiceTest\isCoreUpdateEnabledReturnsFalseFor_TYPO3_DISABLE_CORE_UPDATER_EnvironmentVariableSet
‪isCoreUpdateEnabledReturnsFalseFor_TYPO3_DISABLE_CORE_UPDATER_EnvironmentVariableSet()
Definition: CoreUpdateServiceTest.php:57
‪TYPO3\CMS\Install\Tests\Unit\Service\CoreUpdateServiceTest\isCoreUpdateEnabledReturnsTrueForEnvironmentVariableNotSet
‪isCoreUpdateEnabledReturnsTrueForEnvironmentVariableNotSet()
Definition: CoreUpdateServiceTest.php:42
‪TYPO3\CMS\Install\Tests\Unit\Service\CoreUpdateServiceTest\isCoreUpdateEnabledReturnsFalseFor_REDIRECT_TYPO3_DISABLE_CORE_UPDATER_EnvironmentVariableSet
‪isCoreUpdateEnabledReturnsFalseFor_REDIRECT_TYPO3_DISABLE_CORE_UPDATER_EnvironmentVariableSet()
Definition: CoreUpdateServiceTest.php:69
‪TYPO3\CMS\Install\Tests\Unit\Service\CoreUpdateServiceTest
Definition: CoreUpdateServiceTest.php:26
‪TYPO3\CMS\Install\Service\CoreUpdateService
Definition: CoreUpdateService.php:40
‪TYPO3\CMS\Core\Messaging\FlashMessageQueue
Definition: FlashMessageQueue.php:29
‪TYPO3\CMS\Install\Tests\Unit\Service
Definition: ClearTableServiceTest.php:16
‪TYPO3\CMS\Install\Tests\Unit\Service\CoreUpdateServiceTest\getMessagesReturnsPreviouslySetMessage
‪getMessagesReturnsPreviouslySetMessage()
Definition: CoreUpdateServiceTest.php:30