[TASK] Tests: Remove extbase BaseTestCase 45/28445/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 16 Mar 2014 14:34:53 +0000 (15:34 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 16 Mar 2014 14:48:37 +0000 (15:48 +0100)
Lots of unit tests did inherit from extbase BaseTestCase. Meanwhile
all code of this abstract was merged to ext:core UnitTestCase and
with the refactoring of the core unit test boostrap the objectManager
that is still in this class does not work anymore.
The class is now removed, but since this is probably used in some
third party extensions, it is set as class alias to ext:core
UnitTestCase and marked as deprecated in a lecagy file, so IDEs
hint developers about this deprecation.

Change-Id: I31fb337e065aed7f03351cb04e13c68a98c93a34
Resolves: #56963
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28445
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/core/Tests/BaseTestCase.php
typo3/sysext/extbase/Migrations/Code/ClassAliasMap.php
typo3/sysext/extbase/Migrations/Code/LegacyClassesForIde.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/BaseTestCase.php [deleted file]
typo3/sysext/extensionmanager/Tests/Unit/Utility/ExtensionModelUtilityTest.php

index f187a67..a3f5ad1 100644 (file)
@@ -2854,7 +2854,7 @@ class Tx_Extbase_SignalSlot_Exception_InvalidSlotException extends \TYPO3\CMS\Ex
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class Tx_Extbase_Tests_Unit_BaseTestCase extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {}
+class Tx_Extbase_Tests_Unit_BaseTestCase extends \TYPO3\CMS\Core\Tests\UnitTestCase {}
 
 /**
  * @deprecated since 6.0 will be removed in 7.0
index 8d89a4c..135b065 100644 (file)
@@ -58,7 +58,7 @@ abstract class BaseTestCase extends \PHPUnit_Framework_TestCase {
         * @param boolean $callOriginalClone whether to call the __clone method
         * @param boolean $callAutoload whether to call any autoload function
         *
-        * @return \PHPUnit_Framework_MockObject_MockObject|AccessibleObjectInterface
+        * @return \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
         *         a mock of $originalClassName with access methods added
         *
         * @throws \InvalidArgumentException
@@ -95,7 +95,7 @@ abstract class BaseTestCase extends \PHPUnit_Framework_TestCase {
         *
         * @throws \InvalidArgumentException
         *
-        * @return \PHPUnit_Framework_MockObject_MockObject|AccessibleObjectInterface
+        * @return \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
         *
         */
        protected function getAccessibleMockForAbstractClass(
@@ -121,10 +121,7 @@ abstract class BaseTestCase extends \PHPUnit_Framework_TestCase {
         * 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');
index 4dbd56b..d8606c5 100644 (file)
@@ -278,7 +278,8 @@ return array(
        'Tx_Extbase_Service_TypoScriptService' => 'TYPO3\\CMS\\Extbase\\Service\\TypoScriptService',
        'Tx_Extbase_SignalSlot_Dispatcher' => 'TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher',
        'Tx_Extbase_SignalSlot_Exception_InvalidSlotException' => 'TYPO3\\CMS\\Extbase\\SignalSlot\\Exception\\InvalidSlotException',
-       'Tx_Extbase_Tests_Unit_BaseTestCase' => 'TYPO3\\CMS\Extbase\\Tests\\Unit\\BaseTestCase',
+       'Tx_Extbase_Tests_Unit_BaseTestCase' => 'TYPO3\\CMS\\Core\\Tests\\UnitTestCase',
+       'TYPO3\\CMS\\Extbase\\Tests\\Unit\\BaseTestCase' => 'TYPO3\\CMS\\Core\\Tests\\UnitTestCase',
        'Tx_Extbase_Utility_Arrays' => 'TYPO3\\CMS\\Extbase\\Utility\\ArrayUtility',
        'Tx_Extbase_Utility_Debugger' => 'TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility',
        'Tx_Extbase_Utility_ExtbaseRequirementsCheck' => 'TYPO3\\CMS\\Extbase\\Utility\\ExtbaseRequirementsCheckUtility',
diff --git a/typo3/sysext/extbase/Migrations/Code/LegacyClassesForIde.php b/typo3/sysext/extbase/Migrations/Code/LegacyClassesForIde.php
new file mode 100644 (file)
index 0000000..de57de3
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+namespace TYPO3\CMS\Extbase\Tests\Unit;
+
+/**
+ * @deprecated since 6.2 will be removed in 7.0
+ */
+class BaseTestCase extends \TYPO3\CMS\Core\Tests\UnitTestCase {}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Tests/Unit/BaseTestCase.php b/typo3/sysext/extbase/Tests/Unit/BaseTestCase.php
deleted file mode 100644 (file)
index 2d035ca..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit;
-
-/***************************************************************
- *  Copyright notice
- *
- *  This class is a backport of the corresponding class of TYPO3 Flow.
- *  All credits go to the TYPO3 Flow team.
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the text file GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * Base testcase for the Extbase extension.
- */
-abstract class BaseTestCase extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface The object manager
-        */
-       protected $objectManager;
-
-       /**
-        * Injects an untainted clone of the object manager and all its referencing
-        * objects for every test.
-        *
-        * @return void
-        */
-       public function runBare() {
-               $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
-               $this->objectManager = clone $objectManager;
-               parent::runBare();
-       }
-}
index 66cc80d..7ec16c0 100644 (file)
@@ -26,9 +26,9 @@ namespace TYPO3\CMS\Extensionmanager\Tests\Unit\Utility;
 
 /**
  * Test for ExtensionModelUtilityTest
- *
  */
-class ExtensionModelUtilityTest extends \TYPO3\CMS\Core\Tests\BaseTestCase {
+class ExtensionModelUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+
        /**
         * @test
         * @return void