TYPO3 CMS  TYPO3_6-2
CoreUpdateServiceTest.php
Go to the documentation of this file.
1 <?php
3 
21 
25  public function getMessagesReturnsPreviouslySetMessage() {
27  $instance = $this->getAccessibleMock('TYPO3\\CMS\\Install\\Service\\CoreUpdateService', array('dummy'), array(), '', FALSE);
28  $aMessage = $this->getUniqueId('message_');
29  $instance->_set('messages', $aMessage);
30  $this->assertSame($aMessage, $instance->getMessages());
31  }
32 
36  public function isCoreUpdateEnabledReturnsTrueForEnvironmentVariableNotSet() {
38  $instance = $this->getAccessibleMock('TYPO3\\CMS\\Install\\Service\\CoreUpdateService', array('dummy'), array(), '', FALSE);
39  putenv('TYPO3_DISABLE_CORE_UPDATER');
40  putenv('REDIRECT_TYPO3_DISABLE_CORE_UPDATER');
41  $this->assertTrue($instance->isCoreUpdateEnabled());
42  }
43 
47  public function isCoreUpdateEnabledReturnsFalseFor_TYPO3_DISABLE_CORE_UPDATER_EnvironmentVariableSet() {
49  $instance = $this->getAccessibleMock('TYPO3\\CMS\\Install\\Service\\CoreUpdateService', array('dummy'), array(), '', FALSE);
50  putenv('TYPO3_DISABLE_CORE_UPDATER=1');
51  putenv('REDIRECT_TYPO3_DISABLE_CORE_UPDATER');
52  $this->assertFalse($instance->isCoreUpdateEnabled());
53  }
54 
58  public function isCoreUpdateEnabledReturnsFalseFor_REDIRECT_TYPO3_DISABLE_CORE_UPDATER_EnvironmentVariableSet() {
60  $instance = $this->getAccessibleMock('TYPO3\\CMS\\Install\\Service\\CoreUpdateService', array('dummy'), array(), '', FALSE);
61  putenv('TYPO3_DISABLE_CORE_UPDATER');
62  putenv('REDIRECT_TYPO3_DISABLE_CORE_UPDATER=1');
63  $this->assertFalse($instance->isCoreUpdateEnabled());
64  }
65 }
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)