[TASK] Namespace SystemEnvironmentBuilderTest
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 11 Sep 2012 19:49:40 +0000 (21:49 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 11 Sep 2012 19:54:18 +0000 (21:54 +0200)
* Move BaseSetupTest to SystemEnvironmentBuilderTest and namespace it.
* Introduce an AccessibleProxy for the protected methods instead of eval.
* Merge config_defaultTest to SystemEnvironmentBuilderTest

Change-Id: Ie90857962087e235a7f4a8eb53df120624fd8780
Resolves: #40836
Related: #40095
Releases: 6.0
Reviewed-on: http://review.typo3.org/14527
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
tests/Unit/t3lib/class.config_defaultTest.php [deleted file]
tests/Unit/typo3/Classes/Bootstrap/BaseSetupTest.php [deleted file]
typo3/sysext/core/Tests/Unit/Core/SystemEnvironmentBuilderTest.php [new file with mode: 0644]

diff --git a/tests/Unit/t3lib/class.config_defaultTest.php b/tests/Unit/t3lib/class.config_defaultTest.php
deleted file mode 100644 (file)
index 7b83157..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2010-2011 Oliver Hader <oliver@typo3.org>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * Test case for basic core related constants in config_default.php
- *
- * @author Oliver Hader <oliver@typo3.org>
- * @TODO : This test should be moved elsewhere?!
- * @package TYPO3
- */
-class config_defaultTest extends tx_phpunit_testcase {
-
-       /**
-        * Tests whether an accordant PHP extension is denied.
-        *
-        * @param string phpExtension
-        * @dataProvider phpExtensionsDataProvider
-        * @test
-        */
-       public function fileDenyPatternMatchesPhpExtension($phpExtension) {
-               $this->assertGreaterThan(0, preg_match(('/' . FILE_DENY_PATTERN_DEFAULT) . '/', $phpExtension), $phpExtension);
-       }
-
-       /**
-        * Data provider for 'fileDenyPatternMatchesPhpExtension' test case.
-        *
-        * @return array
-        */
-       public function phpExtensionsDataProvider() {
-               $fileName = uniqid('filename');
-               $data = array();
-               $phpExtensions = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', 'php,php3,php4,php5,php6,phpsh,phtml', TRUE);
-               foreach ($phpExtensions as $extension) {
-                       $data[] = array(($fileName . '.') . $extension);
-                       $data[] = array((($fileName . '.') . $extension) . '.txt');
-               }
-               return $data;
-       }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tests/Unit/typo3/Classes/Bootstrap/BaseSetupTest.php b/tests/Unit/typo3/Classes/Bootstrap/BaseSetupTest.php
deleted file mode 100644 (file)
index 7fe46ba..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * Testcase for class Typo3_Bootstrap_BaseSetup
- *
- * @author Christia Kuhn <lolli@schwarbu.ch>
- * @package TYPO3
- * @subpackage tests
- */
-class Typo3_Bootstrap_BaseSetupTest extends tx_phpunit_testcase {
-
-       /**
-        * Enable backup of global and system variables
-        *
-        * @var boolean
-        */
-       protected $backupGlobals = TRUE;
-
-       /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS because of included ressource
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
-        * Set up testcase
-        *
-        * @return void
-        */
-       public function setUp() {
-               $this->createAccessibleProxyClass();
-       }
-
-       /**
-        * Create a subclass of Typo3_Bootstrap_BaseSetup with
-        * protected methods made public
-        *
-        * @return void
-        */
-       protected function createAccessibleProxyClass() {
-               $namespace = 'TYPO3\\CMS\\Core\\Core';
-               $className = 'SystemEnvironmentBuilderAccessibleProxy';
-               if (!class_exists($namespace . '\\' .$className, FALSE)) {
-                       eval(((((((((((((((((((((((('namespace ' . $namespace . '; class ' . $className) . ' extends \\TYPO3\\CMS\\Core\\Core\\SystemEnvironmentBuilder {') . '  public static function getPathThisScriptCli() {') . '    return parent::getPathThisScriptCli();') . '  }') . '  public static function getUnifiedDirectoryNameWithTrailingSlash($absolutePath) {') . '    return parent::getUnifiedDirectoryNameWithTrailingSlash($absolutePath);') . '  }') . '  public static function addCorePearPathToIncludePath() {') . '    return parent::addCorePearPathToIncludePath();') . '  }') . '  public static function initializeGlobalVariables() {') . '    return parent::initializeGlobalVariables();') . '  }') . '  public static function loadDefaultConfiguration() {') . '    return parent::loadDefaultConfiguration();') . '  }') . '  public static function initializeGlobalTimeTrackingVariables() {') . '    return parent::initializeGlobalTimeTrackingVariables();') . '  }') . '  public static function initializeBasicErrorReporting() {') . '    return parent::initializeBasicErrorReporting();') . '  }') . '}');
-               }
-       }
-
-       /**
-        * @test
-        */
-       public function getPathThisScriptCliReadsLocalPartFromArgv() {
-               $fakedLocalPart = uniqid('Test');
-               $GLOBALS['_SERVER']['argv'][0] = $fakedLocalPart;
-               $this->assertStringEndsWith($fakedLocalPart, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::getPathThisScriptCli());
-       }
-
-       /**
-        * @test
-        */
-       public function getPathThisScriptCliReadsLocalPartFromEnv() {
-               $fakedLocalPart = uniqid('Test');
-               unset($GLOBALS['_SERVER']['argv']);
-               $GLOBALS['_ENV']['_'] = $fakedLocalPart;
-               $this->assertStringEndsWith($fakedLocalPart, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::getPathThisScriptCli());
-       }
-
-       /**
-        * @test
-        */
-       public function getPathThisScriptCliReadsLocalPartFromServer() {
-               $fakedLocalPart = uniqid('Test');
-               unset($GLOBALS['_SERVER']['argv']);
-               unset($GLOBALS['_ENV']['_']);
-               $GLOBALS['_SERVER']['_'] = $fakedLocalPart;
-               $this->assertStringEndsWith($fakedLocalPart, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::getPathThisScriptCli());
-       }
-
-       /**
-        * @test
-        */
-       public function getPathThisScriptCliAddsCurrentWorkingDirectoryFromServerEnvironmentToLocalPathOnUnix() {
-               if (TYPO3_OS === 'WIN') {
-                       $this->markTestSkipped('Test not available on Windows OS.');
-               }
-               $GLOBALS['_SERVER']['argv'][0] = 'foo';
-               $fakedAbsolutePart = ('/' . uniqid('Absolute')) . '/';
-               $_SERVER['PWD'] = $fakedAbsolutePart;
-               $this->assertStringStartsWith($fakedAbsolutePart, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::getPathThisScriptCli());
-       }
-
-       /**
-        * @test
-        */
-       public function getUnifiedDirectoryNameWithTrailingSlashReturnsCorrectPathOnUnix() {
-               if (TYPO3_OS === 'WIN') {
-                       $this->markTestSkipped('Test not available on Windows OS.');
-               }
-               $input = '/foo/bar/test.php';
-               $expected = '/foo/bar/';
-               $actual = \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::getUnifiedDirectoryNameWithTrailingSlash($input);
-               $this->assertEquals($expected, $actual);
-       }
-
-       /**
-        * @test
-        */
-       public function addCorePearPathToIncludePathAddsTypo3ContribPearToPathAsFirstEntry() {
-               $backupPath = get_include_path();
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::addCorePearPathToIncludePath();
-               $actualValue = get_include_path();
-               set_include_path($backupPath);
-               $this->assertStringStartsWith((PATH_typo3 . 'contrib/pear/') . PATH_SEPARATOR, $actualValue);
-       }
-
-       /**
-        * @test
-        */
-       public function initializeGlobalVariablesUnsetsGlobalErrorArray() {
-               $GLOBALS['error'] = 'foo';
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeGlobalVariables();
-               $this->assertFalse(isset($GLOBALS['error']));
-       }
-
-       /**
-        * @test
-        */
-       public function initializeGlobalVariablesSetsGlobalClientArray() {
-               unset($GLOBALS['CLIENT']);
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeGlobalVariables();
-               $this->assertArrayHasKey('CLIENT', $GLOBALS);
-       }
-
-       /**
-        * @test
-        */
-       public function initializeGlobalVariablesSetsGlobalTypo3MiscArray() {
-               unset($GLOBALS['TYPO3_MISC']);
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeGlobalVariables();
-               $this->assertInternalType('array', $GLOBALS['TYPO3_MISC']);
-       }
-
-       /**
-        * @test
-        */
-       public function initializeGlobalVariablesSetsGlobalT3VarArray() {
-               unset($GLOBALS['T3_VAR']);
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeGlobalVariables();
-               $this->assertInternalType('array', $GLOBALS['T3_VAR']);
-       }
-
-       /**
-        * @test
-        */
-       public function initializeGlobalVariablesSetsGlobalT3ServicesArray() {
-               unset($GLOBALS['T3_SERVICES']);
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeGlobalVariables();
-               $this->assertInternalType('array', $GLOBALS['T3_SERVICES']);
-       }
-
-       /**
-        * @test
-        */
-       public function loadDefaultConfigurationPopulatesTypo3ConfVarsArray() {
-               unset($GLOBALS['TYPO3_CONF_VARS']);
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::loadDefaultConfiguration();
-               $this->assertInternalType('array', $GLOBALS['TYPO3_CONF_VARS']);
-       }
-
-       /**
-        * Data provider for initializeGlobalTimeTrackingVariablesSetsGlobalVariables
-        *
-        * @return array
-        */
-       public function initializeGlobalTimeTrackingVariablesSetsGlobalVariablesDataProvider() {
-               return array(
-                       'PARSETIME_START' => array('PARSETIME_START'),
-                       'EXEC_TIME' => array('EXEC_TIME'),
-                       'ACCESS_TIME' => array('ACCESS_TIME'),
-                       'SIM_EXEC_TIME' => array('SIM_EXEC_TIME'),
-                       'SIM_ACCESS_TIME' => array('SIM_ACCESS_TIME')
-               );
-       }
-
-       /**
-        * @test
-        * @dataProvider initializeGlobalTimeTrackingVariablesSetsGlobalVariablesDataProvider
-        * @param string $variable Variable to check for in $GLOBALS
-        */
-       public function initializeGlobalTimeTrackingVariablesSetsGlobalVariables($variable) {
-               unset($GLOBALS[$variable]);
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeGlobalTimeTrackingVariables();
-               $this->assertTrue(isset($GLOBALS[$variable]));
-       }
-
-       /**
-        * @test
-        */
-       public function initializeGlobalTimeTrackingVariablesSetsGlobalTypo3MiscMicrotimeStart() {
-               unset($GLOBALS['TYPO3_MISC']['microtime_start']);
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeGlobalTimeTrackingVariables();
-               $this->assertTrue(isset($GLOBALS['TYPO3_MISC']['microtime_start']));
-       }
-
-       /**
-        * @test
-        */
-       public function initializeGlobalTimeTrackingVariablesRoundsAccessTimeToSixtySeconds() {
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeGlobalTimeTrackingVariables();
-               $this->assertEquals(0, $GLOBALS['ACCESS_TIME'] % 60);
-       }
-
-       /**
-        * @test
-        */
-       public function initializeGlobalTimeTrackingVariablesRoundsSimAccessTimeToSixtySeconds() {
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeGlobalTimeTrackingVariables();
-               $this->assertEquals(0, $GLOBALS['SIM_ACCESS_TIME'] % 60);
-       }
-
-       /**
-        * @test
-        */
-       public function initializeBasicErrorReportingExcludesStrict() {
-               $backupReporting = error_reporting();
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeBasicErrorReporting();
-               $actualReporting = error_reporting();
-               error_reporting($backupReporting);
-               $this->assertEquals(0, $actualReporting & E_STRICT);
-       }
-
-       /**
-        * @test
-        */
-       public function initializeBasicErrorReportingExcludesNotice() {
-               $backupReporting = error_reporting();
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeBasicErrorReporting();
-               $actualReporting = error_reporting();
-               error_reporting($backupReporting);
-               $this->assertEquals(0, $actualReporting & E_NOTICE);
-       }
-
-       /**
-        * @test
-        */
-       public function initializeBasicErrorReportingExcludesDeprecated() {
-               $backupReporting = error_reporting();
-               \TYPO3\CMS\Core\Core\SystemEnvironmentBuilderAccessibleProxy::initializeBasicErrorReporting();
-               $actualReporting = error_reporting();
-               error_reporting($backupReporting);
-               $this->assertEquals(0, $actualReporting & E_DEPRECATED);
-       }
-
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/core/Tests/Unit/Core/SystemEnvironmentBuilderTest.php b/typo3/sysext/core/Tests/Unit/Core/SystemEnvironmentBuilderTest.php
new file mode 100644 (file)
index 0000000..46b41bc
--- /dev/null
@@ -0,0 +1,309 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\Unit\Core;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+/**
+ * Testcase
+ *
+ * @author Christia Kuhn <lolli@schwarzbu.ch>
+ * @package TYPO3
+ * @subpackage tests
+ */
+class SystemEnvironmentBuilderTest extends \tx_phpunit_testcase {
+
+       /**
+        * Enable backup of global and system variables
+        *
+        * @var boolean
+        */
+       protected $backupGlobals = TRUE;
+
+       /**
+        * Exclude TYPO3_DB from backup/ restore of $GLOBALS because of included ressource
+        *
+        * @var array
+        */
+       protected $backupGlobalsBlacklist = array('TYPO3_DB');
+
+       /**
+        * @var \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder|\Tx_Phpunit_Interface_AccessibleObject
+        */
+       protected $fixture = NULL;
+
+       /**
+        * Set up testcase
+        *
+        * @return void
+        */
+       public function setUp() {
+               $this->fixture = $this->getAccessibleMock('TYPO3\\CMS\\Core\\Core\\SystemEnvironmentBuilder', array('dummy'));
+       }
+
+       /**
+        * Tear down
+        *
+        * @return void
+        */
+       public function tearDown() {
+               unset($this->fixture);
+       }
+
+       /**
+        * Data provider for 'fileDenyPatternMatchesPhpExtension' test case.
+        *
+        * @return array
+        */
+       public function fileDenyPatternMatchesPhpExtensionDataProvider() {
+               $fileName = uniqid('filename');
+               $data = array();
+               $phpExtensions = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', 'php,php3,php4,php5,php6,phpsh,phtml', TRUE);
+               foreach ($phpExtensions as $extension) {
+                       $data[] = array($fileName . '.' . $extension);
+                       $data[] = array($fileName . '.' . $extension . '.txt');
+               }
+               return $data;
+       }
+
+       /**
+        * Tests whether an accordant PHP extension is denied.
+        *
+        * @test
+        * @dataProvider fileDenyPatternMatchesPhpExtensionDataProvider
+        * @param string $phpExtension
+        */
+       public function fileDenyPatternMatchesPhpExtension($phpExtension) {
+               $this->assertGreaterThan(0, preg_match(('/' . FILE_DENY_PATTERN_DEFAULT) . '/', $phpExtension), $phpExtension);
+       }
+
+       /**
+        * @test
+        */
+       public function getPathThisScriptCliReadsLocalPartFromArgv() {
+               $fakedLocalPart = uniqid('Test');
+               $GLOBALS['_SERVER']['argv'][0] = $fakedLocalPart;
+               $this->assertStringEndsWith($fakedLocalPart, $this->fixture->_call('getPathThisScriptCli'));
+       }
+
+       /**
+        * @test
+        */
+       public function getPathThisScriptCliReadsLocalPartFromEnv() {
+               $fakedLocalPart = uniqid('Test');
+               unset($GLOBALS['_SERVER']['argv']);
+               $GLOBALS['_ENV']['_'] = $fakedLocalPart;
+               $this->assertStringEndsWith($fakedLocalPart, $this->fixture->_call('getPathThisScriptCli'));
+       }
+
+       /**
+        * @test
+        */
+       public function getPathThisScriptCliReadsLocalPartFromServer() {
+               $fakedLocalPart = uniqid('Test');
+               unset($GLOBALS['_SERVER']['argv']);
+               unset($GLOBALS['_ENV']['_']);
+               $GLOBALS['_SERVER']['_'] = $fakedLocalPart;
+               $this->assertStringEndsWith($fakedLocalPart, $this->fixture->_call('getPathThisScriptCli'));
+       }
+
+       /**
+        * @test
+        */
+       public function getPathThisScriptCliAddsCurrentWorkingDirectoryFromServerEnvironmentToLocalPathOnUnix() {
+               if (TYPO3_OS === 'WIN') {
+                       $this->markTestSkipped('Test not available on Windows OS.');
+               }
+               $GLOBALS['_SERVER']['argv'][0] = 'foo';
+               $fakedAbsolutePart = ('/' . uniqid('Absolute')) . '/';
+               $_SERVER['PWD'] = $fakedAbsolutePart;
+               $this->assertStringStartsWith($fakedAbsolutePart, $this->fixture->_call('getPathThisScriptCli'));
+       }
+
+       /**
+        * @test
+        */
+       public function getUnifiedDirectoryNameWithTrailingSlashReturnsCorrectPathOnUnix() {
+               if (TYPO3_OS === 'WIN') {
+                       $this->markTestSkipped('Test not available on Windows OS.');
+               }
+               $input = '/foo/bar/test.php';
+               $expected = '/foo/bar/';
+               $actual = $this->fixture->_call('getUnifiedDirectoryNameWithTrailingSlash', $input);
+               $this->assertEquals($expected, $actual);
+       }
+
+       /**
+        * @test
+        */
+       public function addCorePearPathToIncludePathAddsTypo3ContribPearToPathAsFirstEntry() {
+               $backupPath = get_include_path();
+               $this->fixture->_call('addCorePearPathToIncludePath');
+               $actualValue = get_include_path();
+               set_include_path($backupPath);
+               $this->assertStringStartsWith((PATH_typo3 . 'contrib/pear/') . PATH_SEPARATOR, $actualValue);
+       }
+
+       /**
+        * @test
+        */
+       public function initializeGlobalVariablesUnsetsGlobalErrorArray() {
+               $GLOBALS['error'] = 'foo';
+               $this->fixture->_call('initializeGlobalVariables');
+               $this->assertFalse(isset($GLOBALS['error']));
+       }
+
+       /**
+        * @test
+        */
+       public function initializeGlobalVariablesSetsGlobalClientArray() {
+               unset($GLOBALS['CLIENT']);
+               $this->fixture->_call('initializeGlobalVariables');
+               $this->assertArrayHasKey('CLIENT', $GLOBALS);
+       }
+
+       /**
+        * @test
+        */
+       public function initializeGlobalVariablesSetsGlobalTypo3MiscArray() {
+               unset($GLOBALS['TYPO3_MISC']);
+               $this->fixture->_call('initializeGlobalVariables');
+               $this->assertInternalType('array', $GLOBALS['TYPO3_MISC']);
+       }
+
+       /**
+        * @test
+        */
+       public function initializeGlobalVariablesSetsGlobalT3VarArray() {
+               unset($GLOBALS['T3_VAR']);
+               $this->fixture->_call('initializeGlobalVariables');
+               $this->assertInternalType('array', $GLOBALS['T3_VAR']);
+       }
+
+       /**
+        * @test
+        */
+       public function initializeGlobalVariablesSetsGlobalT3ServicesArray() {
+               unset($GLOBALS['T3_SERVICES']);
+               $this->fixture->_call('initializeGlobalVariables');
+               $this->assertInternalType('array', $GLOBALS['T3_SERVICES']);
+       }
+
+       /**
+        * @test
+        */
+       public function loadDefaultConfigurationPopulatesTypo3ConfVarsArray() {
+               unset($GLOBALS['TYPO3_CONF_VARS']);
+               $this->fixture->_call('loadDefaultConfiguration');
+               $this->assertInternalType('array', $GLOBALS['TYPO3_CONF_VARS']);
+       }
+
+       /**
+        * Data provider for initializeGlobalTimeTrackingVariablesSetsGlobalVariables
+        *
+        * @return array
+        */
+       public function initializeGlobalTimeTrackingVariablesSetsGlobalVariablesDataProvider() {
+               return array(
+                       'PARSETIME_START' => array('PARSETIME_START'),
+                       'EXEC_TIME' => array('EXEC_TIME'),
+                       'ACCESS_TIME' => array('ACCESS_TIME'),
+                       'SIM_EXEC_TIME' => array('SIM_EXEC_TIME'),
+                       'SIM_ACCESS_TIME' => array('SIM_ACCESS_TIME')
+               );
+       }
+
+       /**
+        * @test
+        * @dataProvider initializeGlobalTimeTrackingVariablesSetsGlobalVariablesDataProvider
+        * @param string $variable Variable to check for in $GLOBALS
+        */
+       public function initializeGlobalTimeTrackingVariablesSetsGlobalVariables($variable) {
+               unset($GLOBALS[$variable]);
+               $this->fixture->_call('initializeGlobalTimeTrackingVariables');
+               $this->assertTrue(isset($GLOBALS[$variable]));
+       }
+
+       /**
+        * @test
+        */
+       public function initializeGlobalTimeTrackingVariablesSetsGlobalTypo3MiscMicrotimeStart() {
+               unset($GLOBALS['TYPO3_MISC']['microtime_start']);
+               $this->fixture->_call('initializeGlobalTimeTrackingVariables');
+               $this->assertTrue(isset($GLOBALS['TYPO3_MISC']['microtime_start']));
+       }
+
+       /**
+        * @test
+        */
+       public function initializeGlobalTimeTrackingVariablesRoundsAccessTimeToSixtySeconds() {
+               $this->fixture->_call('initializeGlobalTimeTrackingVariables');
+               $this->assertEquals(0, $GLOBALS['ACCESS_TIME'] % 60);
+       }
+
+       /**
+        * @test
+        */
+       public function initializeGlobalTimeTrackingVariablesRoundsSimAccessTimeToSixtySeconds() {
+               $this->fixture->_call('initializeGlobalTimeTrackingVariables');
+               $this->assertEquals(0, $GLOBALS['SIM_ACCESS_TIME'] % 60);
+       }
+
+       /**
+        * @test
+        */
+       public function initializeBasicErrorReportingExcludesStrict() {
+               $backupReporting = error_reporting();
+               $this->fixture->_call('initializeBasicErrorReporting');
+               $actualReporting = error_reporting();
+               error_reporting($backupReporting);
+               $this->assertEquals(0, $actualReporting & E_STRICT);
+       }
+
+       /**
+        * @test
+        */
+       public function initializeBasicErrorReportingExcludesNotice() {
+               $backupReporting = error_reporting();
+               $this->fixture->_call('initializeBasicErrorReporting');
+               $actualReporting = error_reporting();
+               error_reporting($backupReporting);
+               $this->assertEquals(0, $actualReporting & E_NOTICE);
+       }
+
+       /**
+        * @test
+        */
+       public function initializeBasicErrorReportingExcludesDeprecated() {
+               $backupReporting = error_reporting();
+               $this->fixture->_call('initializeBasicErrorReporting');
+               $actualReporting = error_reporting();
+               error_reporting($backupReporting);
+               $this->assertEquals(0, $actualReporting & E_DEPRECATED);
+       }
+
+}
+
+?>
\ No newline at end of file