‪TYPO3CMS  9.5
CoreUpdateServiceTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
19 
23 class ‪CoreUpdateServiceTest extends UnitTestCase
24 {
29  {
31  $instance = $this->getAccessibleMock(\‪TYPO3\CMS\Install\Service\CoreUpdateService::class, ['dummy'], [], '', false);
32  $aMessage = new ‪FlashMessageQueue('install');
33  $instance->_set('messages', $aMessage);
34  $this->assertSame($aMessage, $instance->getMessages());
35  }
36 
41  {
42  if (defined('TYPO3_COMPOSER_MODE') && TYPO3_COMPOSER_MODE) {
43  $this->markTestSkipped('This test is only available in Non-Composer mode.');
44  }
46  $instance = $this->getAccessibleMock(\‪TYPO3\CMS\Install\Service\CoreUpdateService::class, ['dummy'], [], '', false);
47  putenv('TYPO3_DISABLE_CORE_UPDATER');
48  putenv('REDIRECT_TYPO3_DISABLE_CORE_UPDATER');
49  $this->assertTrue($instance->isCoreUpdateEnabled());
50  }
51 
56  {
58  $instance = $this->getAccessibleMock(\‪TYPO3\CMS\Install\Service\CoreUpdateService::class, ['dummy'], [], '', false);
59  putenv('TYPO3_DISABLE_CORE_UPDATER=1');
60  putenv('REDIRECT_TYPO3_DISABLE_CORE_UPDATER');
61  $this->assertFalse($instance->isCoreUpdateEnabled());
62  }
63 
68  {
70  $instance = $this->getAccessibleMock(\‪TYPO3\CMS\Install\Service\CoreUpdateService::class, ['dummy'], [], '', false);
71  putenv('TYPO3_DISABLE_CORE_UPDATER');
72  putenv('REDIRECT_TYPO3_DISABLE_CORE_UPDATER=1');
73  $this->assertFalse($instance->isCoreUpdateEnabled());
74  }
75 }
‪TYPO3
‪TYPO3\CMS\Install\Tests\Unit\Service\CoreUpdateServiceTest\isCoreUpdateEnabledReturnsFalseFor_TYPO3_DISABLE_CORE_UPDATER_EnvironmentVariableSet
‪isCoreUpdateEnabledReturnsFalseFor_TYPO3_DISABLE_CORE_UPDATER_EnvironmentVariableSet()
Definition: CoreUpdateServiceTest.php:55
‪TYPO3\CMS\Install\Tests\Unit\Service\CoreUpdateServiceTest\isCoreUpdateEnabledReturnsTrueForEnvironmentVariableNotSet
‪isCoreUpdateEnabledReturnsTrueForEnvironmentVariableNotSet()
Definition: CoreUpdateServiceTest.php:40
‪TYPO3\CMS\Install\Tests\Unit\Service\CoreUpdateServiceTest\isCoreUpdateEnabledReturnsFalseFor_REDIRECT_TYPO3_DISABLE_CORE_UPDATER_EnvironmentVariableSet
‪isCoreUpdateEnabledReturnsFalseFor_REDIRECT_TYPO3_DISABLE_CORE_UPDATER_EnvironmentVariableSet()
Definition: CoreUpdateServiceTest.php:67
‪TYPO3\CMS\Install\Tests\Unit\Service\CoreUpdateServiceTest
Definition: CoreUpdateServiceTest.php:24
‪TYPO3\CMS\Core\Messaging\FlashMessageQueue
Definition: FlashMessageQueue.php:25
‪TYPO3\CMS\Install\Tests\Unit\Service
Definition: ClearTableServiceTest.php:2
‪TYPO3\CMS\Install\Tests\Unit\Service\CoreUpdateServiceTest\getMessagesReturnsPreviouslySetMessage
‪getMessagesReturnsPreviouslySetMessage()
Definition: CoreUpdateServiceTest.php:28