[TASK] Introduce base class for PHPUnit tests
authorMarkus Klein <klein.t3@mfc-linz.at>
Fri, 21 Sep 2012 14:14:33 +0000 (16:14 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 22 Sep 2012 21:33:37 +0000 (23:33 +0200)
Previously all core unit tests extended from the
Tx_PhpUnit_TestCase. This turned out to be problematic
because the core tests relied on the behaviour of that
class and we could not easily change behaviour centrally
for the core tests.
Because of that, we introduced several own base test classes
which added functionality for specific test cases.

With introducing a new base test case class which is
extended by all core test, we can consolidate helper
functions and specific wanted behaviour like blacklisting
TYPO3_DB globals for all tests.

Additionally all tests will benefit from
future enhancements in the base class.

Resolves: #41171
Releases: 6.0

Change-Id: Ic9e5c4b128ffb81cc9228e080a9d4a7909ee9dcd
Reviewed-on: http://review.typo3.org/14836
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
119 files changed:
typo3/sysext/backend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php
typo3/sysext/backend/Tests/Unit/Module/ModuleControllerTest.php
typo3/sysext/backend/Tests/Unit/Sprite/SpriteManagerTest.php
typo3/sysext/backend/Tests/Unit/Tree/Pagetree/DataProviderTest.php
typo3/sysext/backend/Tests/Unit/Tree/SortedTreeNodeCollectionTest.php
typo3/sysext/backend/Tests/Unit/Tree/TreeNodeCollectionTest.php
typo3/sysext/backend/Tests/Unit/Tree/TreeNodeTest.php
typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php
typo3/sysext/backend/Tests/Unit/Utility/IconUtilityTest.php
typo3/sysext/belog/Tests/Unit/Domain/Repository/HistoryEntryRepositoryTest.php
typo3/sysext/core/Tests/AccessibleObjectInterface.php [new file with mode: 0644]
typo3/sysext/core/Tests/BaseTestCase.php [new file with mode: 0644]
typo3/sysext/core/Tests/Functional/Category/Collection/CategoryCollectionTest.php
typo3/sysext/core/Tests/FunctionalTestCase.php [new file with mode: 0644]
typo3/sysext/core/Tests/Integrity/IntegrityTest.php
typo3/sysext/core/Tests/Legacy/t3lib/class.t3lib_formmailTest.php
typo3/sysext/core/Tests/Legacy/typo3/contrib/class.removexssTest.php
typo3/sysext/core/Tests/Unit/Authentication/AbstractUserAuthenticationTest.php
typo3/sysext/core/Tests/Unit/Authentication/BackendUserAuthenticationTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/AbstractBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/ApcBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/DbBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/FileBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/MemcachedBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/PdoBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/RedisBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/TransientMemoryBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/WincacheBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/CacheManagerTest.php
typo3/sysext/core/Tests/Unit/Cache/FactoryTest.php
typo3/sysext/core/Tests/Unit/Cache/Frontend/AbstractFrontendTest.php
typo3/sysext/core/Tests/Unit/Cache/Frontend/PhpFrontendTest.php
typo3/sysext/core/Tests/Unit/Cache/Frontend/StringFrontendTest.php
typo3/sysext/core/Tests/Unit/Cache/Frontend/VariableFrontendTest.php
typo3/sysext/core/Tests/Unit/Category/CategoryRegistryTest.php
typo3/sysext/core/Tests/Unit/Category/Collection/CategoryCollectionTest.php
typo3/sysext/core/Tests/Unit/Charset/CharsetConverterTest.php
typo3/sysext/core/Tests/Unit/Collection/RecordCollectionRepositoryTest.php
typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php
typo3/sysext/core/Tests/Unit/Core/ClassLoaderTest.php
typo3/sysext/core/Tests/Unit/Core/SystemEnvironmentBuilderTest.php
typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php
typo3/sysext/core/Tests/Unit/Database/DatabaseConnectionTest.php
typo3/sysext/core/Tests/Unit/Database/PreparedStatementTest.php
typo3/sysext/core/Tests/Unit/Database/SqlParserTest.php
typo3/sysext/core/Tests/Unit/Encoder/JavaScriptEncoderTest.php
typo3/sysext/core/Tests/Unit/Error/DebugExceptionHandlerTest.php
typo3/sysext/core/Tests/Unit/Error/ProductionExceptionHandlerTest.php
typo3/sysext/core/Tests/Unit/Extension/ExtensionManagerTest.php
typo3/sysext/core/Tests/Unit/FormProtection/AbstractFormProtectionTest.php
typo3/sysext/core/Tests/Unit/FormProtection/BackendFormProtectionTest.php
typo3/sysext/core/Tests/Unit/FormProtection/FormProtectionFactoryTest.php
typo3/sysext/core/Tests/Unit/FormProtection/InstallToolFormProtectionTest.php
typo3/sysext/core/Tests/Unit/Html/RteHtmlParserTest.php
typo3/sysext/core/Tests/Unit/Localization/Parser/LocallangXmlParserTest.php
typo3/sysext/core/Tests/Unit/Localization/Parser/XliffParserTest.php
typo3/sysext/core/Tests/Unit/Locking/LockerTest.php
typo3/sysext/core/Tests/Unit/Log/LogLevelTest.php
typo3/sysext/core/Tests/Unit/Log/LogManagerTest.php
typo3/sysext/core/Tests/Unit/Log/LogRecordTest.php
typo3/sysext/core/Tests/Unit/Log/LoggerTest.php
typo3/sysext/core/Tests/Unit/Log/Processor/AbstractMemoryTest.php
typo3/sysext/core/Tests/Unit/Log/Processor/AbstractTest.php
typo3/sysext/core/Tests/Unit/Log/Processor/IntrospectionTest.php
typo3/sysext/core/Tests/Unit/Log/Processor/MemoryPeakUsageTest.php
typo3/sysext/core/Tests/Unit/Log/Processor/MemoryUsageTest.php
typo3/sysext/core/Tests/Unit/Log/Processor/ProcessorTest.php
typo3/sysext/core/Tests/Unit/Log/Processor/WebTest.php
typo3/sysext/core/Tests/Unit/Log/Writer/AbstractTest.php
typo3/sysext/core/Tests/Unit/Log/Writer/DatabaseTest.php
typo3/sysext/core/Tests/Unit/Log/Writer/FileTest.php
typo3/sysext/core/Tests/Unit/Mail/MailerTest.php
typo3/sysext/core/Tests/Unit/Mail/SwiftMailerAdapterTest.php
typo3/sysext/core/Tests/Unit/Page/PageRendererTest.php
typo3/sysext/core/Tests/Unit/RegistryTest.php
typo3/sysext/core/Tests/Unit/Resource/BaseTestCase.php
typo3/sysext/core/Tests/Unit/Resource/Driver/DriverRegistryTest.php
typo3/sysext/core/Tests/Unit/Resource/FactoryTest.php
typo3/sysext/core/Tests/Unit/Resource/FileTest.php
typo3/sysext/core/Tests/Unit/Resource/FolderTest.php
typo3/sysext/core/Tests/Unit/Resource/Repository/AbstractRepositoryTest.php
typo3/sysext/core/Tests/Unit/Resource/Service/IndexerServiceTest.php
typo3/sysext/core/Tests/Unit/Resource/Utility/FileExtensionFilterTest.php
typo3/sysext/core/Tests/Unit/TypoScript/TemplateServiceTest.php
typo3/sysext/core/Tests/Unit/Utility/ArrayUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/ClientUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/File/ExtendedFileUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/HttpUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/MailUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/MathUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/PathUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/RootlineUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/StringUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/VersionNumberUtilityTest.php
typo3/sysext/core/Tests/UnitTestCase.php [new file with mode: 0644]
typo3/sysext/extbase
typo3/sysext/extensionmanager/Tests/Unit/Controller/UpdateFromTerControllerTest.php
typo3/sysext/extensionmanager/Tests/Unit/Domain/Repository/ConfigurationItemRepositoryTest.php
typo3/sysext/felogin/Tests/Unit/Controller/FrontendLoginControllerTest.php
typo3/sysext/frontend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/AbstractMenuContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php
typo3/sysext/frontend/Tests/Unit/Page/CacheHashCalculatorTest.php
typo3/sysext/frontend/Tests/Unit/Page/PageRepositoryTest.php
typo3/sysext/frontend/Tests/Unit/View/AdminPanelViewTest.php
typo3/sysext/indexed_search/Tests/Unit/IndexerTest.php
typo3/sysext/install/Tests/Unit/InstallToolTest.php
typo3/sysext/integrity/Tests/Unit/Utility/ArrayBrowserTest.php
typo3/sysext/saltedpasswords/Tests/Unit/Salt/BlowfishSaltTest.php
typo3/sysext/saltedpasswords/Tests/Unit/Salt/Md5SaltTest.php
typo3/sysext/saltedpasswords/Tests/Unit/Salt/PhpassSaltTest.php
typo3/sysext/saltedpasswords/Tests/Unit/Salt/SaltFactoryTest.php
typo3/sysext/saltedpasswords/Tests/Unit/Utility/SaltedPasswordsUtilityTest.php
typo3/sysext/scheduler/Tests/Unit/Controller/SchedulerModuleControllerTest.php
typo3/sysext/scheduler/Tests/Unit/CronCommand/CronCommandTest.php
typo3/sysext/scheduler/Tests/Unit/CronCommand/NormalizeCommandTest.php
typo3/sysext/scheduler/Tests/Unit/Task/CachingFrameworkGarbageCollectionTest.php

index 7a1f03b..39c454f 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Configuration\TypoScript\ConditionMatchin
  * @package TYPO3
  * @subpackage t3lib
  */
-class ConditionMatcherTest extends \tx_phpunit_testcase {
+class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var array
index 26bfcba..68ffd08 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Module;
  * @package TYPO3
  * @subpackage backend
  */
-class ModuleControllerTest extends \Tx_PhpUnit_TestCase {
+class ModuleControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var TYPO3\CMS\Backend\Module\ModuleController
index 327a18f..c3b7ebc 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Sprite;
  * @package TYPO3
  * @subpackage t3lib
  */
-class SpriteManagerTest extends \tx_phpunit_testcase {
+class SpriteManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -39,14 +39,6 @@ class SpriteManagerTest extends \tx_phpunit_testcase {
         */
        protected $backupGlobals = TRUE;
 
-       /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
        //////////////////////////////////////////
        // Tests concerning addTcaTypeIcon
        //////////////////////////////////////////
index 9191123..7492ce7 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Tree\Pagetree;
  * @package TYPO3
  * @subpackage t3lib
  */
-class DataProviderTest extends \tx_phpunit_testcase {
+class DataProviderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var boolean
@@ -39,13 +39,6 @@ class DataProviderTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Excludes TYPO3_DB from backup/restore of $GLOBALS because resource types cannot be handled during serializing.
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var \TYPO3\CMS\Backend\Tree\Pagetree\DataProvider|\PHPUnit_Framework_MockObject_MockObject
         */
        protected $fixture = NULL;
index 83e7764..e1066f5 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Tree;
  * @package TYPO3
  * @subpackage t3lib
  */
-class SortedTreeNodeCollectionTest extends \tx_phpunit_testcase {
+class SortedTreeNodeCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        protected function createTestCollection() {
                $nodeCollection = new \TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection();
index 27b8f21..9fc2637 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Tree;
  * @package TYPO3
  * @subpackage t3lib
  */
-class TreeNodeCollectionTest extends \tx_phpunit_testcase {
+class TreeNodeCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        public function setUp() {
 
index 14ef87f..48db1c2 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Tree;
  * @package TYPO3
  * @subpackage t3lib
  */
-class TreeNodeTest extends \tx_phpunit_testcase {
+class TreeNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        //////////////////////
        // Utility functions
index fb94e2c..c02bba8 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Utility;
  * @subpackage t3lib
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class BackendUtilityTest extends \tx_phpunit_testcase {
+class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Backend\Utility\BackendUtility
index 95fb395..f4e2c4a 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace TYPO3\CMS\Backend\Tests\Unit\Utility;
+use TYPO3\CMS\Backend\Utility\IconUtility;
 
 /***************************************************************
  *  Copyright notice
@@ -33,7 +34,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Utility;
  * @package TYPO3
  * @subpackage t3lib
  */
-class IconUtilityTest extends \tx_phpunit_testcase {
+class IconUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -43,17 +44,14 @@ class IconUtilityTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
         * @var array
         */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB', 'TBE_STYLES');
+       protected $mockRecord;
 
        /**
         * @var array
         */
-       protected $mockRecord;
+       static protected $tbeStylesBackup = array();
 
        /**
         * Set up test case
@@ -61,9 +59,16 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @return void
         */
        public function setUp() {
-               if (!\TYPO3\CMS\Backend\Sprite\SpriteManager::isInitialized()) {
-                       \TYPO3\CMS\Backend\Sprite\SpriteManager::initialize();
+               // Initialize sprites (done only once)
+               \TYPO3\CMS\Backend\Sprite\SpriteManager::initialize();
+               // Backup sprites because they will be reset by PHPUnit global backup
+               if (empty(self::$tbeStylesBackup)) {
+                       self::$tbeStylesBackup = $GLOBALS['TBE_STYLES'];
+               } else {
+                       // Restore the internal backup
+                       $GLOBALS['TBE_STYLES'] = self::$tbeStylesBackup;
                }
+
                // Simulate a tt_content record
                $this->mockRecord = array();
                $this->mockRecord['header'] = 'dummy content header';
@@ -103,7 +108,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
                $fixtureGifRessource = imagecreatefromgif($fixtureGifFile);
                $targetFilename = PATH_site . 'typo3temp/' . uniqid('test_') . '.gif';
                $GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask'] = '0777';
-               \TYPO3\CMS\Backend\Utility\IconUtility::imagemake($fixtureGifRessource, $targetFilename);
+               IconUtility::imagemake($fixtureGifRessource, $targetFilename);
                clearstatcache();
                $resultFilePermissions = substr(decoct(fileperms($targetFilename)), 2);
                \TYPO3\CMS\Core\Utility\GeneralUtility::unlink_tempfile($targetFilename);
@@ -119,7 +124,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconClassesWithEmptyStringReturnsT3Icon() {
-               $this->assertEquals('t3-icon', \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses(''));
+               $this->assertEquals('t3-icon', IconUtility::getSpriteIconClasses(''));
        }
 
        /**
@@ -128,7 +133,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconClassesWithOnePartReturnsT3Icon() {
-               $this->assertEquals('t3-icon', \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('actions'));
+               $this->assertEquals('t3-icon', IconUtility::getSpriteIconClasses('actions'));
        }
 
        /**
@@ -137,7 +142,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconClassesWithTwoPartsReturnsT3IconAndCombinedParts() {
-               $result = explode(' ', \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('actions-juggle'));
+               $result = explode(' ', IconUtility::getSpriteIconClasses('actions-juggle'));
                sort($result);
                $this->assertEquals(array('t3-icon', 't3-icon-actions', 't3-icon-actions-juggle', 't3-icon-juggle'), $result);
        }
@@ -148,7 +153,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconClassesWithThreePartsReturnsT3IconAndCombinedParts() {
-               $result = explode(' ', \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('actions-juggle-speed'));
+               $result = explode(' ', IconUtility::getSpriteIconClasses('actions-juggle-speed'));
                sort($result);
                $this->assertEquals(array('t3-icon', 't3-icon-actions', 't3-icon-actions-juggle', 't3-icon-juggle-speed'), $result);
        }
@@ -159,7 +164,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconClassesWithFourPartsReturnsT3IconAndCombinedParts() {
-               $result = explode(' ', \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('actions-juggle-speed-game'));
+               $result = explode(' ', IconUtility::getSpriteIconClasses('actions-juggle-speed-game'));
                sort($result);
                $this->assertEquals(array('t3-icon', 't3-icon-actions', 't3-icon-actions-juggle', 't3-icon-juggle-speed-game'), $result);
        }
@@ -173,7 +178,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconWithEmptyStringReturnsSpanWithIconMissingSprite() {
-               $this->assertEquals('<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing">&nbsp;</span>', \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon(''));
+               $this->assertEquals('<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing">&nbsp;</span>', IconUtility::getSpriteIcon(''));
        }
 
        /**
@@ -182,7 +187,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconWithMissingIconReturnsSpanWithIconMissingSprite() {
-               $this->assertEquals('<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing">&nbsp;</span>', \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-juggle-speed'));
+               $this->assertEquals('<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing">&nbsp;</span>', IconUtility::getSpriteIcon('actions-juggle-speed'));
        }
 
        /**
@@ -191,7 +196,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconWithExistingIconReturnsSpanWithIconSprite() {
-               $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">&nbsp;</span>', \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-new'));
+               $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">&nbsp;</span>', IconUtility::getSpriteIcon('actions-document-new'));
        }
 
        /**
@@ -200,7 +205,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconWithExistingIconAndAttributeReturnsSpanWithIconSpriteAndAttribute() {
-               $this->assertEquals('<span title="foo" class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">&nbsp;</span>', \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-new', array('title' => 'foo')));
+               $this->assertEquals('<span title="foo" class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">&nbsp;</span>', IconUtility::getSpriteIcon('actions-document-new', array('title' => 'foo')));
        }
 
        /**
@@ -209,7 +214,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconWithExistingIconAndClassAttributeReturnsSpanWithIconSpriteAndClassAttribute() {
-               $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new foo">&nbsp;</span>', \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-new', array('class' => 'foo')));
+               $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new foo">&nbsp;</span>', IconUtility::getSpriteIcon('actions-document-new', array('class' => 'foo')));
        }
 
        /**
@@ -218,7 +223,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconWithExistingIconAndInnerHTMLReturnsSpanWithIconSpriteAndInnerHTML() {
-               $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">foo</span>', \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-new', array('html' => 'foo')));
+               $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">foo</span>', IconUtility::getSpriteIcon('actions-document-new', array('html' => 'foo')));
        }
 
        /**
@@ -227,7 +232,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconWithExistingIconAndOverlayReturnsSpanWithIconSpriteAndOverlay() {
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-new', array(), array('status-overlay-hidden' => array()));
+               $result = IconUtility::getSpriteIcon('actions-document-new', array(), array('status-overlay-hidden' => array()));
                $overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay">&nbsp;</span>';
                $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">' . $overlay . '</span>', $result);
        }
@@ -238,7 +243,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconWithExistingIconAndOverlayAndAttributesReturnsSpanWithIconSpriteAndOverlayAndAttributes() {
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-new', array('html' => 'foo1'), array('status-overlay-hidden' => array('class' => 'foo2')));
+               $result = IconUtility::getSpriteIcon('actions-document-new', array('html' => 'foo1'), array('status-overlay-hidden' => array('class' => 'foo2')));
                $overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden foo2 t3-icon-overlay">foo1</span>';
                $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">' . $overlay . '</span>', $result);
        }
@@ -252,7 +257,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconForRecordWithNullTableReturnsMissingIcon() {
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('', array());
+               $result = IconUtility::getSpriteIconForRecord('', array());
                $this->assertEquals('<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing">&nbsp;</span>', $result);
        }
 
@@ -262,7 +267,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconForRecordWithEmptyRecordReturnsNormalSprite() {
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('tt_content', array());
+               $result = IconUtility::getSpriteIconForRecord('tt_content', array());
                $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text">&nbsp;</span>', $result);
        }
 
@@ -273,7 +278,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         */
        public function getSpriteIconForRecordWithMockRecordReturnsNormalSprite() {
                $mockRecord = $this->mockRecord;
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('tt_content', $mockRecord);
+               $result = IconUtility::getSpriteIconForRecord('tt_content', $mockRecord);
                $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text">&nbsp;</span>', $result);
        }
 
@@ -284,7 +289,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         */
        public function getSpriteIconForRecordWithMockRecordAndOptionsReturnsNormalSprite() {
                $mockRecord = $this->mockRecord;
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('tt_content', $mockRecord, array('class' => 'foo', 'title' => 'bar'));
+               $result = IconUtility::getSpriteIconForRecord('tt_content', $mockRecord, array('class' => 'foo', 'title' => 'bar'));
                $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text foo" title="bar">&nbsp;</span>', $result);
        }
 
@@ -296,7 +301,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
        public function getSpriteIconForRecordWithMockRecordOfTypePluginReturnsPluginSprite() {
                $mockRecord = $this->mockRecord;
                $mockRecord['CType'] = 'list';
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('tt_content', $mockRecord);
+               $result = IconUtility::getSpriteIconForRecord('tt_content', $mockRecord);
                $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-plugin">&nbsp;</span>', $result);
        }
 
@@ -308,7 +313,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
        public function getSpriteIconForRecordWithMockRecordWithHiddenFlagReturnsNormalSpriteAndOverlay() {
                $mockRecord = $this->mockRecord;
                $mockRecord['hidden'] = '1';
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('tt_content', $mockRecord);
+               $result = IconUtility::getSpriteIconForRecord('tt_content', $mockRecord);
                $overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay">&nbsp;</span>';
                $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text">' . $overlay . '</span>', $result);
        }
@@ -322,7 +327,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconForFileWithNoFileTypeReturnsOtherSprite() {
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForFile('');
+               $result = IconUtility::getSpriteIconForFile('');
                $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other">&nbsp;</span>', $result);
        }
 
@@ -332,7 +337,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconForFileWithNoUnknowFileTypeReturnsOtherSprite() {
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForFile('foo');
+               $result = IconUtility::getSpriteIconForFile('foo');
                $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other">&nbsp;</span>', $result);
        }
 
@@ -342,7 +347,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconForFileWithPdfReturnsPdfSprite() {
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForFile('pdf');
+               $result = IconUtility::getSpriteIconForFile('pdf');
                $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-pdf t3-icon-pdf">&nbsp;</span>', $result);
        }
 
@@ -352,7 +357,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconForFileWithPngReturnsPngSprite() {
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForFile('png');
+               $result = IconUtility::getSpriteIconForFile('png');
                $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image">&nbsp;</span>', $result);
        }
 
@@ -362,7 +367,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
         * @test
         */
        public function getSpriteIconForFileWithPngAndOptionsReturnsPngSpriteAndOptions() {
-               $result = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForFile('png', array('title' => 'bar'));
+               $result = IconUtility::getSpriteIconForFile('png', array('title' => 'bar'));
                $this->assertEquals('<span title="bar" class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image">&nbsp;</span>', $result);
        }
 
@@ -377,7 +382,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
                $hookMock->expects($this->once())->method('overrideIconOverlay');
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay'][$classReference] = $classReference;
                $GLOBALS['T3_VAR']['getUserObj'][$classReference] = $hookMock;
-               \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordOverlayToSpriteIconName('tt_content', array());
+               IconUtility::mapRecordOverlayToSpriteIconName('tt_content', array());
        }
 
        /**
@@ -389,7 +394,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
                $classReference = uniqid('user_overrideIconOverlayHook');
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay'][$classReference] = $classReference;
                $GLOBALS['T3_VAR']['getUserObj'][$classReference] = new \stdClass();
-               \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordOverlayToSpriteIconName('tt_content', array());
+               IconUtility::mapRecordOverlayToSpriteIconName('tt_content', array());
        }
 
 }
index 8f059ef..a28a6de 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Belog\Tests\Unit\Domain\Repository;
 class HistoryEntryRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings||\Tx_Phpunit_Interface_AccessibleObject
+        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
         */
        protected $querySettings = NULL;
 
diff --git a/typo3/sysext/core/Tests/AccessibleObjectInterface.php b/typo3/sysext/core/Tests/AccessibleObjectInterface.php
new file mode 100644 (file)
index 0000000..fb58ed4
--- /dev/null
@@ -0,0 +1,113 @@
+<?php
+namespace TYPO3\CMS\Core\Tests;
+
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Nicole Cordes <nicole.cordes@googlemail.com>
+ * 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!
+ ***************************************************************/
+
+/**
+ * This interface defines the methods provided by TYPO3\CMS\Core\Tests\TestCase::getAccessibleMock.::
+ *
+ * @package TYPO3
+ *
+ * @author Nicole Cordes <nicole.cordes@googlemail.com>
+ */
+interface AccessibleObjectInterface {
+       /**
+        * Calls the method $method using call_user_func* and returns its return value.
+        *
+        * @param string $methodName name of method to call, must not be empty
+        *
+        * @return mixed the return value from the method $methodName
+        */
+       public function _call($methodName);
+
+       /**
+        * Calls the method $method without using call_user_func* and returns its return value.
+        *
+        * @param string $methodName name of method to call, must not be empty
+        * @param mixed &$arg1 first argument given to method $methodName
+        * @param mixed &$arg2 second argument given to method $methodName
+        * @param mixed &$arg3 third argument given to method $methodName
+        * @param mixed &$arg4 fourth argument given to method $methodName
+        * @param mixed &$arg5 fifth argument given to method $methodName
+        * @param mixed &$arg6 sixth argument given to method $methodName
+        * @param mixed &$arg7 seventh argument given to method $methodName
+        * @param mixed &$arg8 eighth argument given to method $methodName
+        * @param mixed &$arg9 ninth argument given to method $methodName
+        *
+        * @return mixed the return value from the method $methodName
+        */
+       public function _callRef(
+               $methodName, &$arg1 = NULL, &$arg2 = NULL, &$arg3 = NULL, &$arg4 = NULL, &$arg5= NULL, &$arg6 = NULL, &$arg7 = NULL,
+               &$arg8 = NULL, &$arg9 = NULL
+       );
+
+       /**
+        * Sets the value of a property.
+        *
+        * @param string $propertyName name of property to set value for, must not be empty
+        * @param mixed $value the new value for the property defined in $propertyName
+        *
+        * @return void
+        */
+       public function _set($propertyName, $value);
+
+       /**
+        * Sets the value of a property by reference.
+        *
+        * @param string $propertyName name of property to set value for, must not be empty
+        * @param mixed &$value the new value for the property defined in $propertyName
+        *
+        * @return void
+        */
+       public function _setRef($propertyName, &$value);
+
+       /**
+        * Sets the value of a static property.
+        *
+        * @param string $propertyName name of property to set value for, must not be empty
+        * @param mixed $value the new value for the property defined in $propertyName
+        *
+        * @return void
+        */
+       public function _setStatic($propertyName, $value);
+
+       /**
+        * Gets the value of the given property.
+        *
+        * @param string $propertyName name of property to return value of, must not be empty
+        *
+        * @return mixed the value of the property $propertyName
+        */
+       public function _get($propertyName);
+
+       /**
+        * Gets the value of the given static property.
+        *
+        * @param string $propertyName name of property to return value of, must not be empty
+        *
+        * @return mixed the value of the static property $propertyName
+        */
+       public function _getStatic($propertyName);
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/core/Tests/BaseTestCase.php b/typo3/sysext/core/Tests/BaseTestCase.php
new file mode 100644 (file)
index 0000000..9b1df47
--- /dev/null
@@ -0,0 +1,203 @@
+<?php
+namespace TYPO3\CMS\Core\Tests;
+
+ /***************************************************************
+ * Copyright notice
+ *
+ * (c) 2005-2012 Robert Lemke (robert@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!
+ ***************************************************************/
+
+/**
+ * The mother of all test cases.
+ *
+ * Don't sub class this test case but rather choose a more specialized base test case,
+ * such as UnitTestCase or FunctionalTestCase
+ *
+ */
+abstract class BaseTestCase extends \PHPUnit_Framework_TestCase {
+       /**
+        * whether global variables should be backuped
+        *
+        * @var boolean
+        */
+       protected $backupGlobals = TRUE;
+
+       /**
+        * whether static attributes should be backuped
+        *
+        * @var boolean
+        */
+       protected $backupStaticAttributes = FALSE;
+
+       /**
+        * Exclude TYPO3_DB from backup/restore of $GLOBALS
+        * because resource types cannot be handled during serializing
+        *
+        * @var array
+        */
+       protected $backupGlobalsBlacklist = array('TYPO3_DB');
+
+       /**
+        * Creates a mock object which allows for calling protected methods and access of protected properties.
+        *
+        * @param string $originalClassName name of class to create the mock object of, must not be empty
+        * @param array<string> $methods name of the methods to mock
+        * @param array $arguments arguments to pass to constructor
+        * @param string $mockClassName the class name to use for the mock class
+        * @param boolean $callOriginalConstructor whether to call the constructor
+        * @param boolean $callOriginalClone whether to call the __clone method
+        * @param boolean $callAutoload whether to call any autoload function
+        *
+        * @return PHPUnit_Framework_MockObject_MockObject|AccessibleObjectInterface
+        *         a mock of $originalClassName with access methods added
+        *
+        * @see Tx_Extbase_Tests_Unit_BaseTestCase::getAccessibleMock
+        */
+       protected function getAccessibleMock(
+               $originalClassName, array $methods = array(), array $arguments = array(), $mockClassName = '',
+               $callOriginalConstructor = TRUE, $callOriginalClone = TRUE, $callAutoload = TRUE
+       ) {
+               if ($originalClassName === '') {
+                       throw new InvalidArgumentException('$originalClassName must not be empty.', 1334701880);
+               }
+
+               return $this->getMock(
+                       $this->buildAccessibleProxy($originalClassName),
+                       $methods,
+                       $arguments,
+                       $mockClassName,
+                       $callOriginalConstructor,
+                       $callOriginalClone,
+                       $callAutoload
+               );
+       }
+
+       /**
+        * Creates a proxy class of the specified class which allows
+        * for calling even protected methods and access of protected properties.
+        *
+        * @param string $className Name of class to make available, must not be empty
+        *
+        * @return string Fully qualified name of the built class, will not be empty
+        *
+        * @see Tx_Extbase_Tests_Unit_BaseTestCase::buildAccessibleProxy
+        */
+       protected function buildAccessibleProxy($className) {
+               $accessibleClassName = uniqid('Tx_Phpunit_AccessibleProxy');
+               $class = new \ReflectionClass($className);
+               $abstractModifier = $class->isAbstract() ? 'abstract ' : '';
+
+               eval(
+                       $abstractModifier . 'class ' . $accessibleClassName .
+                               ' extends ' . $className . ' implements \TYPO3\CMS\Core\Tests\AccessibleObjectInterface {' .
+                                       'public function _call($methodName) {' .
+                                               'if ($methodName === \'\') {' .
+                                                       'throw new InvalidArgumentException(\'$methodName must not be empty.\', 1334663993);' .
+                                               '}' .
+                                               '$args = func_get_args();' .
+                                               'return call_user_func_array(array($this, $methodName), array_slice($args, 1));' .
+                                       '}' .
+                                       'public function _callRef(' .
+                                               '$methodName, &$arg1 = NULL, &$arg2 = NULL, &$arg3 = NULL, &$arg4 = NULL, &$arg5= NULL, &$arg6 = NULL, ' .
+                                               '&$arg7 = NULL, &$arg8 = NULL, &$arg9 = NULL' .
+                                       ') {' .
+                                               'if ($methodName === \'\') {' .
+                                                       'throw new InvalidArgumentException(\'$methodName must not be empty.\', 1334664210);' .
+                                               '}' .
+                                               'switch (func_num_args()) {' .
+                                                       'case 0:' .
+                                                               'throw new RuntimeException(\'The case of 0 arguments is not supposed to happen.\', 1334703124);' .
+                                                               'break;' .
+                                                       'case 1:' .
+                                                               '$returnValue = $this->$methodName();' .
+                                                               'break;' .
+                                                       'case 2:' .
+                                                               '$returnValue = $this->$methodName($arg1);' .
+                                                               'break;' .
+                                                       'case 3:' .
+                                                               '$returnValue = $this->$methodName($arg1, $arg2);' .
+                                                               'break;' .
+                                                       'case 4:' .
+                                                               '$returnValue = $this->$methodName($arg1, $arg2, $arg3);' .
+                                                               'break;' .
+                                                       'case 5:' .
+                                                               '$returnValue = $this->$methodName($arg1, $arg2, $arg3, $arg4);' .
+                                                               'break;' .
+                                                       'case 6:' .
+                                                               '$returnValue = $this->$methodName($arg1, $arg2, $arg3, $arg4, $arg5);' .
+                                                               'break;' .
+                                                       'case 7:' .
+                                                               '$returnValue = $this->$methodName($arg1, $arg2, $arg3, $arg4, $arg5, $arg6);' .
+                                                               'break;' .
+                                                       'case 8:' .
+                                                               '$returnValue = $this->$methodName($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7);' .
+                                                               'break;' .
+                                                       'case 9:' .
+                                                               '$returnValue = $this->$methodName($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8);' .
+                                                               'break;' .
+                                                       'case 10:' .
+                                                               '$returnValue = $this->$methodName(' .
+                                                                       '$arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8, $arg9' .
+                                                               ');' .
+                                                               'break;' .
+                                                       'default:' .
+                                                               'throw new InvalidArgumentException(' .
+                                                                       '\'_callRef currently only allows calls to methods with no more than 9 parameters.\'' .
+                                                               ');' .
+                                               '}' .
+                                               'return $returnValue;' .
+                                       '}' .
+                                       'public function _set($propertyName, $value) {' .
+                                               'if ($propertyName === \'\') {' .
+                                                       'throw new InvalidArgumentException(\'$propertyName must not be empty.\', 1334664355);' .
+                                               '}' .
+                                               '$this->$propertyName = $value;' .
+                                       '}' .
+                                       'public function _setRef($propertyName, &$value) {' .
+                                               'if ($propertyName === \'\') {' .
+                                                       'throw new InvalidArgumentException(\'$propertyName must not be empty.\', 1334664545);' .
+                                               '}' .
+                                               '$this->$propertyName = $value;' .
+                                       '}' .
+                                       'public function _setStatic($propertyName, $value) {' .
+                                               'if ($propertyName === \'\') {' .
+                                                       'throw new InvalidArgumentException(\'$propertyName must not be empty.\', 1344242602);' .
+                                               '}' .
+                                               'self::$$propertyName = $value;' .
+                                       '}' .
+                                       'public function _get($propertyName) {' .
+                                               'if ($propertyName === \'\') {' .
+                                                       'throw new InvalidArgumentException(\'$propertyName must not be empty.\', 1334664967);' .
+                                               '}' .
+                                               'return $this->$propertyName;' .
+                                       '}' .
+                                       'public function _getStatic($propertyName) {' .
+                                               'if ($propertyName === \'\') {' .
+                                                       'throw new InvalidArgumentException(\'$propertyName must not be empty.\', 1344242603);' .
+                                               '}' .
+                                               'return self::$$propertyName;' .
+                                       '}' .
+                       '}'
+               );
+
+               return $accessibleClassName;
+       }
+}
+?>
\ No newline at end of file
index 7f71461..797f031 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Functional\Category\Collection;
  * @subpackage t3lib
  * @author Fabien Udriot <fabien.udriot@typo3.org>
  */
-class CategoryCollectionTest extends \tx_phpunit_testcase {
+class CategoryCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Category\Collection\CategoryCollection
diff --git a/typo3/sysext/core/Tests/FunctionalTestCase.php b/typo3/sysext/core/Tests/FunctionalTestCase.php
new file mode 100644 (file)
index 0000000..cd71d33
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+namespace TYPO3\CMS\Core\Tests;
+
+ /***************************************************************
+ * Copyright notice
+ *
+ * (c) 2005-2012 Robert Lemke (robert@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!
+ ***************************************************************/
+
+/**
+ * Base test case for functional tests.
+ *
+ * This class currently only inherits the base test case. However, it is recommended
+ * to extend this class for unit test cases instead of the base test case because if,
+ * at some point, specific behavior needs to be implemented for unit tests, your test cases
+ * will profit from it automatically.
+ *
+ */
+abstract class FunctionalTestCase extends BaseTestCase {
+
+}
+?>
\ No newline at end of file
index 3f77ba5..1b30b68 100644 (file)
@@ -32,7 +32,7 @@ namespace TYPO3\CMS\Core\Tests\Integrity;
  * should fail if some other test before destroys the environment with
  * invalid mocking or backups.
  */
-class IntegrityTest extends \Tx_Phpunit_TestCase {
+class IntegrityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * This test fails if some test before either set
index e90245d..e9291bc 100644 (file)
@@ -32,7 +32,7 @@
  * @package TYPO3
  * @subpackage t3lib
  */
-class t3lib_formmailTest extends tx_phpunit_testcase {
+class t3lib_formmailTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        ///////////////////////////////
        // tests concerning __destruct
index 083dce2..75c1057 100644 (file)
@@ -33,7 +33,7 @@ require_once(PATH_typo3 . 'contrib/RemoveXSS/RemoveXSS.php');
  * @ see http://ha.ckers.org/xss.html
  * @ examples from http://ha.ckers.org/xssAttacks.xml
  */
-class RemoveXSSTest extends tx_phpunit_testcase {
+class RemoveXSSTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index b8afd72..63d5d13 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Authentication;
  * @package TYPO3
  * @subpackage t3lib
  */
-class AbstractUserAuthenticationTest extends \tx_phpunit_testcase {
+class AbstractUserAuthenticationTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -40,14 +40,6 @@ class AbstractUserAuthenticationTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * phpunit still needs some globals that are
         * reconstructed before $backupGlobals is handled. Those
         * important globals are handled in tearDown() directly.
index 983f997..1a5fb84 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Authentication;
  * @subpackage t3lib
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class BackendUserAuthenticationTest extends \tx_phpunit_testcase {
+class BackendUserAuthenticationTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
@@ -45,14 +45,6 @@ class BackendUserAuthenticationTest extends \tx_phpunit_testcase {
         */
        protected $backupGlobals = TRUE;
 
-       /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
        public function setUp() {
                // reset hooks
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'] = array();
index cbd1a6a..21d6755 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend;
  * @package TYPO3
  * @subpackage tests
  */
-class AbstractBackendTest extends \tx_phpunit_testcase {
+class AbstractBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Cache\Backend\AbstractBackend
index df7b5a4..979efc8 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend;
  * @package TYPO3
  * @subpackage tests
  */
-class ApcBackendTest extends \tx_phpunit_testcase {
+class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Sets up this testcase
index 1ca2883..3c82db2 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend;
  * @package TYPO3
  * @subpackage tests
  */
-class DbBackendTest extends \tx_phpunit_testcase {
+class DbBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -41,14 +41,6 @@ class DbBackendTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var \TYPO3\CMS\Core\Database\DatabaseConnection Backup of original TYPO3_DB instance
         */
        protected $typo3DbBackup;
index e157298..fa8bb13 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend;
  * @package TYPO3
  * @subpackage tests
  */
-class FileBackendTest extends \tx_phpunit_testcase {
+class FileBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -44,14 +44,6 @@ class FileBackendTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serialization
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * Sets up this testcase
         *
         * @return void
index fa66835..4563a9c 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend;
  * @package TYPO3
  * @subpackage tests
  */
-class MemcachedBackendTest extends \tx_phpunit_testcase {
+class MemcachedBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Sets up this testcase
index c0f2341..a94fe2e 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend;
  * @package TYPO3
  * @subpackage tests
  */
-class PdoBackendTest extends \tx_phpunit_testcase {
+class PdoBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -41,14 +41,6 @@ class PdoBackendTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * Sets up this testcase
         */
        public function setUp() {
index fd0972a..59a41b5 100644 (file)
@@ -41,7 +41,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend;
  * @package TYPO3
  * @subpackage tests
  */
-class RedisBackendTest extends \tx_phpunit_testcase {
+class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -51,14 +51,6 @@ class RedisBackendTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * If set, the tearDown() method will flush the cache used by this unit test.
         *
         * @var \TYPO3\CMS\Core\Cache\Backend\RedisBackend
index 88ffc4f..5c52c42 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend;
  * @package TYPO3
  * @subpackage tests
  */
-class TransientMemoryBackendTest extends \tx_phpunit_testcase {
+class TransientMemoryBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @expectedException \TYPO3\CMS\Core\Cache\Exception
index 0abeded..14286e0 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend;
  * @package TYPO3
  * @subpackage tests
  */
-class WincacheBackendTest extends \tx_phpunit_testcase {
+class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Sets up this testcase
index 8227ea1..35141f5 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache;
  * @package TYPO3
  * @subpackage tests
  */
-class CacheManagerTest extends \tx_phpunit_testcase {
+class CacheManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index 93550c6..0b8d131 100644 (file)
@@ -35,7 +35,7 @@ require_once 'Backend/MockBackend.php';
  * @package TYPO3
  * @subpackage tests
  */
-class FactoryTest extends \tx_phpunit_testcase {
+class FactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index 3c25b8a..a4e6c9e 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Frontend;
  * @package TYPO3
  * @subpackage tests
  */
-class AbstractFrontendTest extends \tx_phpunit_testcase {
+class AbstractFrontendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index e9ebcd8..a456aa6 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Frontend;
  * @package TYPO3
  * @subpackage tests
  */
-class PhpFrontendTest extends \tx_phpunit_testcase {
+class PhpFrontendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index ada05fa..e8a3b4e 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Frontend;
  * @package TYPO3
  * @subpackage tests
  */
-class StringFrontendTest extends \tx_phpunit_testcase {
+class StringFrontendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @expectedException \InvalidArgumentException
index e8231eb..1c0d80c 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Frontend;
  * @package TYPO3
  * @subpackage tests
  */
-class VariableFrontendTest extends \tx_phpunit_testcase {
+class VariableFrontendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @expectedException \InvalidArgumentException
index d3fabb1..9dbc5d5 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Category;
  * @subpackage t3lib
  * @author Oliver Hader <oliver.hader@typo3.org>
  */
-class CategoryRegistryTest extends \tx_phpunit_testcase {
+class CategoryRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -41,14 +41,6 @@ class CategoryRegistryTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var \TYPO3\CMS\Core\Category\CategoryRegistry
         */
        protected $fixture;
index e525955..e93454b 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Category\Collection;
  * @subpackage t3lib
  * @author Fabien Udriot <fabien.udriot@typo3.org>
  */
-class CategoryCollectionTest extends \tx_phpunit_testcase {
+class CategoryCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index 8ab5819..cf7c424 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Charset;
  * @subpackage t3lib
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class CharsetConverterTest extends \tx_phpunit_testcase {
+class CharsetConverterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Charset\CharsetConverter
index 76e397a..c0d57c3 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Collection;
  * @package TYPO3
  * @subpackage t3lib
  */
-class RecordCollectionRepositoryTest extends \Tx_Phpunit_TestCase {
+class RecordCollectionRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Collection\RecordCollectionRepository
index 463ebab..95ee559 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Configuration;
  * @package TYPO3
  * @subpackage t3lib
  */
-class ConfigurationManagerTest extends \tx_phpunit_testcase {
+class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Absolute path to files that must be removed
index 558a1b1..e4a39eb 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Core;
  * @subpackage t3lib
  * @author Andreas Wolf <andreas.wolf@ikt-werk.de>
  */
-class ClassLoaderTest extends \Tx_Phpunit_TestCase {
+class ClassLoaderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var boolean Enable backup of global and system variables
@@ -39,14 +39,6 @@ class ClassLoaderTest extends \Tx_Phpunit_TestCase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var array Backup of typo3CacheManager
         */
        protected $typo3CacheManager = NULL;
index be46a92..92c8ab8 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Core;
  * @package TYPO3
  * @subpackage tests
  */
-class SystemEnvironmentBuilderTest extends \tx_phpunit_testcase {
+class SystemEnvironmentBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -43,14 +43,7 @@ class SystemEnvironmentBuilderTest extends \tx_phpunit_testcase {
        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
+        * @var \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
         */
        protected $fixture = NULL;
 
index 9004d1a..0f10d6b 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\DataHandler;
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  * @author Tolleiv Nietsch <info@tolleiv.de>
  */
-class DataHandlerTest extends \tx_phpunit_testcase {
+class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -41,14 +41,6 @@ class DataHandlerTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * a backup of the global database
         *
         * @var \TYPO3\CMS\Core\Database\DatabaseConnection
@@ -236,7 +228,7 @@ class DataHandlerTest extends \tx_phpunit_testcase {
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'] = array();
 
                $GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection');
-               /** @var $fixture \TYPO3\CMS\Core\DataHandling\DataHandler|\tx_phpunit_testcase */
+               /** @var $fixture \TYPO3\CMS\Core\DataHandling\DataHandler|\TYPO3\CMS\Core\Tests\UnitTestCase */
                $fixture = $this->getMock('TYPO3\\CMS\\Core\\DataHandling\\DataHandler', array('newlog', 'checkModifyAccessList', 'tableReadOnly', 'checkRecordUpdateAccess'));
                $fixture->bypassWorkspaceRestrictions = FALSE;
                $fixture->datamap = array(
index bad3a3f..8d3e2a2 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Database;
  * @subpackage t3lib
  * @author Ernesto Baschny <ernst@cron-it.de>
  */
-class DatabaseConnectionTest extends \tx_phpunit_testcase {
+class DatabaseConnectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Database\DatabaseConnection
index 5cd1e82..eafe07c 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Database;
  * @package TYPO3
  * @subpackage tests
  */
-class PreparedStatementTest extends \tx_phpunit_testcase {
+class PreparedStatementTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Backup and restore of the $GLOBALS array.
index 64444d0..6221e17 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Database;
  * @package TYPO3
  * @subpackage t3lib
  */
-class SqlParserTest extends \tx_phpunit_testcase {
+class SqlParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Database\SqlParser
index d350ae5..160c3bd 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Encoder;
  * @subpackage t3lib
  * @author Helmut Hummel <helmut.hummel@typo3.org>
  */
-class JavaScriptEncoderTest extends \Tx_Phpunit_TestCase {
+class JavaScriptEncoderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Encoder\JavaScriptEncoder
index 4f05738..d05cb3b 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Error;
  * @package TYPO3
  * @subpackage t3lib_error
  */
-class DebugExceptionHandlerTest extends \Tx_Phpunit_TestCase {
+class DebugExceptionHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Error\DebugExceptionHandler|\PHPUnit_Framework_MockObject_MockObject
index 52e1d71..8bf5337 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Error;
  * @package TYPO3
  * @subpackage t3lib_error
  */
-class ProductionExceptionHandlerTest extends \Tx_Phpunit_TestCase {
+class ProductionExceptionHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Error\ProductionExceptionHandler|\PHPUnit_Framework_MockObject_MockObject
index ff56e22..b22e0d4 100644 (file)
@@ -32,7 +32,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Extension;
  * @package TYPO3
  * @subpackage t3lib
  */
-class ExtensionManagerTest extends \tx_phpunit_testcase {
+class ExtensionManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var array A backup of registered singleton instances
@@ -47,14 +47,6 @@ class ExtensionManagerTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * phpunit still needs some globals that are
         * reconstructed before $backupGlobals is handled. Those
         * important globals are handled in tearDown() directly.
index a265e7e..573c451 100644 (file)
@@ -33,7 +33,7 @@ require_once 'Fixtures/FormProtectionTesting.php';
  * @subpackage t3lib
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class AbstractFormProtectionTest extends \tx_phpunit_testcase {
+class AbstractFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Tests\Unit\FormProtection\Fixtures\FormProtectionTesting
index 314b8a5..11eadbf 100644 (file)
@@ -32,7 +32,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\FormProtection;
  *
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class BackendFormProtectionTest extends \tx_phpunit_testcase {
+class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * Enable backup of global and system variables
         *
@@ -41,15 +41,6 @@ class BackendFormProtectionTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-
-       /**
         * @var \TYPO3\CMS\Core\FormProtection\BackendFormProtection
         */
        private $fixture;
index d247e00..28a7678 100644 (file)
@@ -34,7 +34,7 @@ require_once 'Fixtures/FormProtectionTesting.php';
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  * @author Ernesto Baschny <ernst@cron-it.de>
  */
-class FormprotectionFactoryTest extends \tx_phpunit_testcase {
+class FormprotectionFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        public function setUp() {
 
index 0f9e9b3..8481146 100644 (file)
@@ -34,7 +34,7 @@ require_once(\TYPO3\CMS\Core\Extension\ExtensionManager::extPath('install') . 'm
  *
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class InstallToolFormProtectionTest extends \tx_phpunit_testcase {
+class InstallToolFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection
         */
index 278290a..1363d71 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Html;
  * @subpackage t3lib
  * @author Stanislas Rolland <typo3@sjbr.ca>
  */
-class RteHtmlParserTest extends \tx_phpunit_testcase {
+class RteHtmlParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Html\RteHtmlParser
index d3271f4..c80bb06 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Localization\Parser;
  * @author Xavier Perseguers <xavier@typo3.org>
  * @package TYPO3
  */
-class LocallangXmlParserTest extends \tx_phpunit_testcase {
+class LocallangXmlParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Localization\Parser\LocallangXmlParser
index a0226fc..ed275a6 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Localization\Parser;
  * @author Xavier Perseguers <xavier@typo3.org>
  * @package TYPO3
  */
-class XliffParserTest extends \tx_phpunit_testcase {
+class XliffParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Localization\Parser\XliffParser
index d7f72a3..7c22221 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Locking;
  * @package TYPO3
  * @subpackage t3lib
  */
-class LockerTest extends \tx_phpunit_testcase {
+class LockerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -40,14 +40,6 @@ class LockerTest extends \tx_phpunit_testcase {
         */
        protected $backupGlobals = TRUE;
 
-       /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
        ///////////////////////////////
        // tests concerning __construct
        ///////////////////////////////
index da31246..e0b5908 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log;
  * @package TYPO3
  * @subpackage t3lib
  */
-class LevelTest extends \tx_phpunit_testcase {
+class LevelTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index 78a1961..a6073a1 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log;
  * @package TYPO3
  * @subpackage t3lib
  */
-class LogManagerTest extends \tx_phpunit_testcase {
+class LogManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -43,14 +43,6 @@ class LogManagerTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var \TYPO3\CMS\Core\Log\LogManager
         */
        protected $logManagerInstance = NULL;
index 13c8f00..75f4740 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log;
  * @package TYPO3
  * @subpackage t3lib
  */
-class RecordTest extends \tx_phpunit_testcase {
+class RecordTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Returns a \TYPO3\CMS\Core\Log\LogRecord
index 5e98502..0e1b426 100644 (file)
@@ -36,7 +36,7 @@ require_once 'Fixtures/WriterFailing.php';
  * @package TYPO3
  * @subpackage t3lib
  */
-class LoggerTest extends \tx_phpunit_testcase {
+class LoggerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index c8e939f..fc8f0f2 100644 (file)
@@ -29,7 +29,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
  *
  * @author Steffen Müller <typo3@t3node.com>
  */
-class AbstractMemoryTest extends \tx_phpunit_testcase {
+class AbstractMemoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index 2136f9e..28497ac 100644 (file)
@@ -31,7 +31,7 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . '../Fixtures/ProcessorFixture.php';
  *
  * @author Steffen Müller <typo3@t3node.com>
  */
-class AbstractTest extends \tx_phpunit_testcase {
+class AbstractTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index 8d43058..22a56c8 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
  * @package TYPO3
  * @subpackage t3lib
  */
-class IntrospectionTest extends \tx_phpunit_testcase {
+class IntrospectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Tests if debug_backtrace values are added to LogRecord
index cfe8952..3540373 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
  * @package TYPO3
  * @subpackage t3lib
  */
-class MemoryPeakUsageTest extends \tx_phpunit_testcase {
+class MemoryPeakUsageTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index 20d8e74..d292381 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
  * @package TYPO3
  * @subpackage t3lib
  */
-class MemoryUsageTest extends \tx_phpunit_testcase {
+class MemoryUsageTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index fdc81a7..b93c8c4 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
  * @package TYPO3
  * @subpackage t3lib
  */
-class ProcessorTest extends \tx_phpunit_testcase implements \TYPO3\CMS\Core\Log\Processor\Processor {
+class ProcessorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase implements \TYPO3\CMS\Core\Log\Processor\Processor {
 
        /**
         * @var bool
index 2c8c5d3..fb78745 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
  * @package TYPO3
  * @subpackage t3lib
  */
-class WebTest extends \tx_phpunit_testcase {
+class WebTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index 068efe0..34eff50 100644 (file)
@@ -31,7 +31,7 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . '../Fixtures/WriterFixture.php';
  *
  * @author Steffen Gebert <steffen.gebert@typo3.org>
  */
-class AbstractTest extends \tx_phpunit_testcase {
+class AbstractTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index 12be4b1..491555e 100644 (file)
@@ -29,7 +29,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log\Writer;
  *
  * @author Steffen Gebert <steffen.gebert@typo3.org>
  */
-class DatabaseTest extends \tx_phpunit_testcase {
+class DatabaseTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Backup and restore of the $GLOBALS array.
index 525f497..2681a88 100644 (file)
@@ -29,7 +29,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log\Writer;
  *
  * @author Steffen Gebert <steffen.gebert@typo3.org>
  */
-class FileTest extends \tx_phpunit_testcase {
+class FileTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var string
index c2358e3..f5621f7 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Mail;
  * @subpackage t3lib
  * @author Helmut Hummel <helmut.hummel@typo3.org>
  */
-class MailerTest extends \tx_phpunit_testcase {
+class MailerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Mail\Mailer
index 64d1004..1ac0928 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Mail;
  * @subpackage t3lib
  * @author Ernesto Baschny <ernst@cron-it.de>
  */
-class SwiftMailerAdapterTest extends \tx_phpunit_testcase {
+class SwiftMailerAdapterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Mail\SwiftMailerAdapter
index 76d5b9e..19edd1b 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Page;
  * @subpackage t3lib
  * @author Steffen Kamper (info@sk-typo3.de)
  */
-class PageRendererTest extends \tx_phpunit_testcase {
+class PageRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -40,14 +40,6 @@ class PageRendererTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var \TYPO3\CMS\Core\Page\PageRenderer
         */
        private $fixture;
index eebef52..94a9d2f 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit;
  * @package TYPO3
  * @subpackage t3lib
  */
-class RegistryTest extends \tx_phpunit_testcase {
+class RegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Registry
index 639a296..3dc2e84 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Resource;
  * @package TYPO3
  * @subpackage t3lib
  */
-abstract class BaseTestCase extends \Tx_Phpunit_TestCase {
+abstract class BaseTestCase extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var string
index ef03bb9..bcac4e0 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Resource\Driver;
  * @package TYPO3
  * @subpackage t3lib
  */
-class DriverRegistryTest extends \Tx_Phpunit_TestCase {
+class DriverRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var boolean Enable backup of global and system variables
@@ -42,14 +42,6 @@ class DriverRegistryTest extends \Tx_Phpunit_TestCase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var \TYPO3\CMS\Core\Resource\Driver\DriverRegistry
         */
        private $fixture;
index a6a04f2..f994e7e 100644 (file)
@@ -33,7 +33,7 @@ require_once 'vfsStream/vfsStream.php';
  * @subpackage t3lib
  * @author Andreas Wolf <andreas.wolf@ikt-werk.de>
  */
-class FactoryTest extends \Tx_Phpunit_TestCase {
+class FactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var array A backup of registered singleton instances
index 09173a2..c4ba86f 100644 (file)
@@ -34,7 +34,7 @@ require_once 'vfsStream/vfsStream.php';
  * @author Andreas Wolf <andreas.wolf@ikt-werk.de>
  * @todo Many, many, many tests are skipped in this test case...
  */
-class FileTest extends \Tx_Phpunit_TestCase {
+class FileTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var array A backup of registered singleton instances
index 0a67b0f..17d8e7a 100644 (file)
@@ -36,7 +36,7 @@ require_once 'vfsStream/vfsStream.php';
  * @subpackage t3lib
  * @author Andreas Wolf <andreas.wolf@ikt-werk.de>
  */
-class FolderTest extends \Tx_Phpunit_TestCase {
+class FolderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var array A backup of registered singleton instances
index 894b7b6..6a55af3 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Resource\Repository;
  * @package TYPO3
  * @subpackage t3lib
  */
-class AbstractRepositoryTest extends \Tx_Phpunit_TestCase {
+class AbstractRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Resource\AbstractRepository
index 570a1e1..eb1eeff 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Resource\Service;
  * @package TYPO3
  * @subpackage t3lib
  */
-class IndexerServiceTest extends \Tx_Phpunit_TestCase {
+class IndexerServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var boolean Backup all $GLOBALS
@@ -42,11 +42,6 @@ class IndexerServiceTest extends \Tx_Phpunit_TestCase {
        protected $backupGlobals = TRUE;
 
        /**
-        * @var array Do not backup TYPO3_DB, it destroys the db resource
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var Store backup of TYPO3_DB
         */
        protected $dbBackup;
index da42de4..fe52832 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Resource\Utility;
  * @package TYPO3
  * @subpackage t3lib
  */
-class FileExtensionFilterTest extends \Tx_Phpunit_TestCase {
+class FileExtensionFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var array A backup of registered singleton instances
index 84f82b1..349bc69 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\TypoScript;
  * @subpackage t3lib
  * @author Christian Kuhn <lolli@schwarzbu.ch>
  */
-class TemplateServiceTest extends \tx_phpunit_testcase {
+class TemplateServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -41,14 +41,6 @@ class TemplateServiceTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @test
         */
        public function versionOlCallsVersionOlOfPageSelectClassWithGivenRow() {
index 13c9c9e..fa6d8ab 100644 (file)
@@ -32,7 +32,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Utility;
  * @package TYPO3
  * @subpackage t3lib
  */
-class ArrayUtilityTest extends \tx_phpunit_testcase {
+class ArrayUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        ///////////////////////
        // Tests concerning filterByValueRecursive
index 74f4374..33babc4 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Utility;
  * @subpackage t3lib
  * @author Steffen Kamper <info@sk-typo3.de>
  */
-class ClientUtilityTest extends \tx_phpunit_testcase {
+class ClientUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * backed-up TYPO3_CONF_VARS SC_OPTIONS
index 7d9aa7e..5dfc012 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Utility\File;
  * @package TYPO3
  * @subpackage t3lib
  */
-class ExtendedFileUtilityTest extends \tx_phpunit_testcase {
+class ExtendedFileUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var boolean Enable backup of global and system variables
@@ -38,14 +38,6 @@ class ExtendedFileUtilityTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var array A backup of registered singleton instances
         */
        protected $singletonInstances = array();
index fcf7453..e529821 100644 (file)
@@ -32,7 +32,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Utility;
  * @package TYPO3
  * @subpackage t3lib
  */
-class GeneralUtilityTest extends \tx_phpunit_testcase {
+class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -42,14 +42,6 @@ class GeneralUtilityTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var array A backup of registered singleton instances
         */
        protected $singletonInstances = array();
index 1538910..63dbe07 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Utility;
  * @package TYPO3
  * @subpackage t3lib
  */
-class HttpUtilityTest extends \tx_phpunit_testcase {
+class HttpUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @param array $urlParts
index c8b8833..359a329 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Utility;
  * @subpackage t3lib
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class MailUtilityTest extends \tx_phpunit_testcase {
+class MailUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var array A backup of registered singleton instances
index 8822a2b..6682aec 100644 (file)
@@ -33,7 +33,7 @@ require_once 'Fixtures/MathUtilityTestClassWithStringRepresentationFixture.php';
  * @package TYPO3
  * @subpackage t3lib
  */
-class MathUtilityTest extends \tx_phpunit_testcase {
+class MathUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        //////////////////////////////////
        // Tests concerning forceIntegerInRange
index 8bd21b1..8b73485 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Utility;
  * @package TYPO3
  * @subpackage t3lib
  */
-class PathUtilityTest extends \tx_phpunit_testcase {
+class PathUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @param array $paths
index 11483ba..d9e7f8b 100644 (file)
@@ -33,7 +33,7 @@ require_once __DIR__ . '/Fixtures/RootlineUtilityTestAccessibleFixture.php';
  * @package TYPO3
  * @subpackage t3lib
  */
-class RootlineUtilityTest extends \tx_phpunit_testcase {
+class RootlineUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /***
         *
index b6b7720..4ece7c3 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Utility;
  * @package TYPO3
  * @subpackage t3lib
  */
-class StringUtilityTest extends \tx_phpunit_testcase {
+class StringUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Data provider for isLastPartOfStrReturnsTrueForMatchingLastParts
index 982862b..2b924bc 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Utility;
  * @package TYPO3
  * @subpackage t3lib
  */
-class VersionNumberUtilityTest extends \tx_phpunit_testcase {
+class VersionNumberUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Data Provider for convertVersionNumberToIntegerConvertsVersionNumbersToIntegers
diff --git a/typo3/sysext/core/Tests/UnitTestCase.php b/typo3/sysext/core/Tests/UnitTestCase.php
new file mode 100644 (file)
index 0000000..ce7b240
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+namespace TYPO3\CMS\Core\Tests;
+
+ /***************************************************************
+ * Copyright notice
+ *
+ * (c) 2005-2012 Robert Lemke (robert@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!
+ ***************************************************************/
+
+/**
+ * Base test case for unit tests.
+ *
+ * This class currently only inherits the base test case. However, it is recommended
+ * to extend this class for unit test cases instead of the base test case because if,
+ * at some point, specific behavior needs to be implemented for unit tests, your test cases
+ * will profit from it automatically.
+ *
+ */
+abstract class UnitTestCase extends BaseTestCase {
+
+}
+?>
\ No newline at end of file
index 2164337..480172a 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 216433747c65d5603a5edd8764bd718635ee9b87
+Subproject commit 480172a2d0b6a450535a07dabc301a46362e99b0
index 3e1c236..9e1ee9c 100644 (file)
@@ -40,14 +40,6 @@ class UpdateFromTerControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTest
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @test
         * @return void
         */
index ec5086e..ab4197e 100644 (file)
@@ -38,11 +38,6 @@ class ConfigurationItemRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\Base
        protected $backupGlobals = TRUE;
 
        /**
-        * @var array Do not backup TYPO3_DB
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ConfigurationItemRepository
         */
        public $configurationItemRepository;
index bc4f0f2..ddeeeb9 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Felogin\Tests\Unit\Controller;
  * @package TYPO3
  * @subpackage felogin
  */
-class FrontendLoginTest extends \tx_phpunit_testcase {
+class FrontendLoginTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -44,20 +44,12 @@ class FrontendLoginTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @var \TYPO3\CMS\Core\Database\DatabaseConnection
         */
        protected $typo3DbBackup;
 
        /**
-        * @var \TYPO3\CMS\Felogin\Controller\FrontendLoginController|\Tx_Phpunit_Interface_AccessibleObject
+        * @var \TYPO3\CMS\Felogin\Controller\FrontendLoginController|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
         */
        protected $accessibleFixture;
 
index 3ba0fea..6f72724 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\Configuration\TypoScript\ConditionMatchi
  * @package TYPO3
  * @subpackage t3lib
  */
-class ConditionMatcherTest extends \tx_phpunit_testcase {
+class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var array
index 3b9dfe3..06890f9 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\ContentObject;
  * @author Oliver Hader <oliver@typo3.org>
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class ContentObjectRendererTest extends \tx_phpunit_testcase {
+class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -41,15 +41,7 @@ class ContentObjectRendererTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
-        * @var \PHPUnit_Framework_MockObject_MockObject|\Tx_Phpunit_Interface_AccessibleObject|\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
+        * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
         */
        private $cObj;
 
index 06ce647..2b5bff8 100644 (file)
@@ -40,14 +40,6 @@ class AbstractMenuContentObjectTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTe
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * A backup of the global database
         *
         * @var \TYPO3\CMS\Core\Database\DatabaseConnection
index 32b0ca4..001f499 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\Controller;
  * @subpackage tslib
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class TypoScriptFrontendControllerTest extends \tx_phpunit_testcase {
+class TypoScriptFrontendControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -40,15 +40,7 @@ class TypoScriptFrontendControllerTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
-        * @var \PHPUnit_Framework_MockObject_MockObject|\Tx_Phpunit_Interface_AccessibleObject|\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
+        * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
         */
        private $fixture;
 
index ddc1d88..422f0a1 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\Page;
  * @package TYPO3
  * @subpackage t3lib
  */
-class CacheHashCalculatorTest extends \tx_phpunit_testcase {
+class CacheHashCalculatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Frontend\Page\CacheHashCalculator
index d44f526..7a5a1b3 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\Page;
  * @package TYPO3
  * @subpackage t3lib
  */
-class PageRepositoryTest extends \tx_phpunit_testcase {
+class PageRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Database\DatabaseConnection
index 3c4cf9d..11b9713 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\View;
  * @subpackage tslib
  * @author Christian Kuhn <lolli@schwarzbu.ch>
  */
-class AdminPanelViewTest extends \tx_phpunit_testcase {
+class AdminPanelViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -39,14 +39,6 @@ class AdminPanelViewTest extends \tx_phpunit_testcase {
         */
        protected $backupGlobals = TRUE;
 
-       /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
        /////////////////////////////////////////////
        // Test concerning extendAdminPanel hook
        /////////////////////////////////////////////
index c1c15f4..dd1294c 100644 (file)
@@ -9,7 +9,7 @@ namespace TYPO3\CMS\IndexedSearch\Tests\Unit;
  * @package TYPO3
  * @subpackage tx_indexedsearch
  */
-class IndexerTest extends \tx_phpunit_testcase {
+class IndexerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -19,14 +19,6 @@ class IndexerTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * Indexer instance
         *
         * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\IndexedSearch\Indexer
index 66263c8..1b7def3 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Install\Tests\Unit;
  * @subpackage tx_install
  * @author Christian Kuhn <lolli@schwarzbu.ch>
  */
-class InstallToolTest extends \tx_phpunit_testcase {
+class InstallToolTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var boolean Enable backup of global and system variables
@@ -46,14 +46,6 @@ class InstallToolTest extends \tx_phpunit_testcase {
        protected $customErrorHandlerUsed = FALSE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * Restore error handler if a different one was set during tests
         */
        public function tearDown() {
index 885346e..dafa243 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Integrity\Tests\Unit\Utility;
  * @subpackage t3lib
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class ArrayBrowserTest extends \tx_phpunit_testcase {
+class ArrayBrowserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Integrity\Utility\ArrayBrowser
index 4dd826f..2930c7f 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Saltedpasswords\Tests\Unit\Salt;
  * @package TYPO3
  * @subpackage tx_saltedpasswords
  */
-class BlowfishSaltTest extends \tx_phpunit_testcase {
+class BlowfishSaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Keeps instance of object to test.
index dbc08e5..abe1cc5 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Saltedpasswords\Tests\Unit\Salt;
  * @package TYPO3
  * @subpackage tx_saltedpasswords
  */
-class Md5SaltTest extends \tx_phpunit_testcase {
+class Md5SaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Keeps instance of object to test.
index d637587..5ac6b45 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Saltedpasswords\Tests\Unit\Salt;
  * @package TYPO3
  * @subpackage tx_saltedpasswords
  */
-class PhpassSaltTest extends \tx_phpunit_testcase {
+class PhpassSaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Keeps instance of object to test.
index aa75e37..48f066a 100644 (file)
@@ -35,7 +35,7 @@ namespace TYPO3\CMS\Saltedpasswords\Tests\Unit\Salt;
  * @package TYPO3
  * @subpackage tx_saltedpasswords
  */
-class SaltFactoryTest extends \tx_phpunit_testcase {
+class SaltFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Keeps instance of object to test.
index bad1921..0c019d6 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Saltedpasswords\Tests\Unit\Utility;
  * @package TYPO3
  * @subpackage tx_saltedpasswords
  */
-class SaltedPasswordsUtilityTest extends \tx_phpunit_testcase {
+class SaltedPasswordsUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -44,14 +44,6 @@ class SaltedPasswordsUtilityTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serializing
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @test
         */
        public function doesReturnExtConfReturnDefaultSettingsIfNoExtensionConfigurationIsFound() {
index 9b4e6c1..d3e6af2 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Scheduler\Tests\Unit\Controller;
  * @subpackage tx_scheduler
  * @author Andy Grunwald <andreas.grunwald@wmdb.de>
  */
-class SchedulerModuleControllerTest extends \tx_phpunit_testcase {
+class SchedulerModuleControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Object to Test: tx_scheduler_Module
index 349fccb..e12f5b3 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Scheduler\Tests\Unit\CronCommand;
  * @subpackage tx_scheduler
  * @author Christian Kuhn <lolli@schwarzbu.ch>
  */
-class CronCommandTest extends \tx_phpunit_testcase {
+class CronCommandTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @const integer timestamp of 1.1.2010 0:00 (Friday), timezone UTC/GMT
index 8e74dc1..688a40b 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Scheduler\Tests\Unit\CronCommand;
  * @package TYPO3
  * @subpackage tx_scheduler
  */
-class NormalizeCommandTest extends \tx_phpunit_testcase {
+class NormalizeCommandTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Create a subclass of tx_scheduler_CronCmd_Normalize with
index 3d7abae..9800e86 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Scheduler\Tests\Unit\Task;
  * @subpackage tx_scheduler
  * @author Christian Kuhn <lolli@schwarzbu.ch>
  */
-class CachingFrameworkGarbageCollectionTest extends \tx_phpunit_testcase {
+class CachingFrameworkGarbageCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Enable backup of global and system variables
@@ -40,14 +40,6 @@ class CachingFrameworkGarbageCollectionTest extends \tx_phpunit_testcase {
        protected $backupGlobals = TRUE;
 
        /**
-        * Exclude TYPO3_DB from backup/ restore of $GLOBALS
-        * because resource types cannot be handled during serialization
-        *
-        * @var array
-        */
-       protected $backupGlobalsBlacklist = array('TYPO3_DB');
-
-       /**
         * @test
         */
        public function executeCallsCollectGarbageOfConfiguredBackend() {