[TASK] Tests: Do not extend from extbase BaseTestCase 34/28434/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 16 Mar 2014 01:00:07 +0000 (02:00 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 16 Mar 2014 12:54:09 +0000 (13:54 +0100)
Changes all extensions except extbase and fluid to extend
from extbase ext:core UnitTestCase instead of ext:extbase
BaseTestCase.

Change-Id: Ifbb1542546f2622ece11471fd057ec469518488a
Resolves: #56949
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28434
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
21 files changed:
typo3/sysext/belog/Tests/Unit/Domain/Model/ConstraintTest.php
typo3/sysext/belog/Tests/Unit/Domain/Model/LogEntryTest.php
typo3/sysext/belog/Tests/Unit/Domain/Repository/HistoryEntryRepositoryTest.php
typo3/sysext/belog/Tests/Unit/Domain/Repository/LogEntryRepositoryTest.php
typo3/sysext/belog/Tests/Unit/Domain/Repository/WorkspaceRepositoryTest.php
typo3/sysext/beuser/Tests/Unit/Domain/Model/BackendUserTest.php
typo3/sysext/beuser/Tests/Unit/Domain/Model/DemandTest.php
typo3/sysext/beuser/Tests/Unit/Domain/Repository/BackendUserRepositoryTest.php
typo3/sysext/beuser/Tests/Unit/Domain/Repository/BackendUserSessionRepositoryTest.php
typo3/sysext/beuser/Tests/Unit/Service/ModuleDataStorageServiceTest.php
typo3/sysext/core/Tests/BaseTestCase.php
typo3/sysext/core/Tests/Unit/Messaging/FlashMessageQueueTest.php
typo3/sysext/core/Tests/Unit/Messaging/FlashMessageServiceTest.php
typo3/sysext/documentation/Tests/Unit/Domain/Model/DocumentFormatTest.php
typo3/sysext/documentation/Tests/Unit/Domain/Model/DocumentTest.php
typo3/sysext/documentation/Tests/Unit/Domain/Model/DocumentTranslationTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/AbstractMenuContentObjectTest.php
typo3/sysext/lang/Tests/Unit/Domain/Model/ExtensionTest.php
typo3/sysext/lang/Tests/Unit/Domain/Model/LanguageSelectionFormTest.php
typo3/sysext/lang/Tests/Unit/Domain/Model/LanguageTest.php
typo3/sysext/lang/Tests/Unit/Domain/Model/UpdateTranslationFormTest.php

index 10e5448..d62911e 100644 (file)
@@ -25,11 +25,10 @@ namespace TYPO3\CMS\Belog\Tests\Unit\Domain\Model;
  ***************************************************************/
 
 /**
- * Testcase for \TYPO3\CMS\Belog\Domain\Model\Constraint
+ * Test case
  *
- * @author Steffen Müller <typo3@t3node.com>
  */
-class ConstraintTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class ConstraintTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Belog\Domain\Model\Constraint
index df7512a..37f4553 100644 (file)
@@ -25,11 +25,10 @@ namespace TYPO3\CMS\Belog\Tests\Unit\Domain\Model;
  ***************************************************************/
 
 /**
- * Testcase
+ * Test case
  *
- * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class LogEntryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class LogEntryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Belog\Domain\Model\LogEntry
index 0e19d85..22bd442 100644 (file)
@@ -25,11 +25,9 @@ namespace TYPO3\CMS\Belog\Tests\Unit\Domain\Repository;
  ***************************************************************/
 
 /**
- * Testcase
- *
- * @author Oliver Klee <typo3-coding@oliverklee.de>
+ * Test case
  */
-class HistoryEntryRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class HistoryEntryRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
index 2259256..7ca20c5 100644 (file)
@@ -26,32 +26,22 @@ namespace TYPO3\CMS\Belog\Tests\Unit\Domain\Repository;
 
 /**
  * Test case
- *
- * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
-class LogEntryRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings
-        */
-       protected $querySettings = NULL;
-
-       public function setUp() {
-               $this->querySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
-               $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->objectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface')->will($this->returnValue($this->querySettings));
-       }
+class LogEntryRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
         */
        public function initializeObjectSetsRespectStoragePidToFalse() {
+               /** @var \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings $querySettings */
+               $querySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
+               $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
+               $objectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface')->will($this->returnValue($querySettings));
                $GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array(), array(), '', FALSE);
-               $this->querySettings->expects($this->atLeastOnce())->method('setRespectStoragePage')->with(FALSE);
+               $querySettings->expects($this->atLeastOnce())->method('setRespectStoragePage')->with(FALSE);
                /** @var \TYPO3\CMS\Belog\Domain\Repository\LogEntryRepository|\PHPUnit_Framework_MockObject_MockObject $subject */
-               $subject = $this->getMock('TYPO3\\CMS\\Belog\\Domain\\Repository\\LogEntryRepository', array('setDefaultQuerySettings'), array($this->objectManager));
-               $subject->expects($this->once())->method('setDefaultQuerySettings')->with($this->querySettings);
+               $subject = $this->getMock('TYPO3\\CMS\\Belog\\Domain\\Repository\\LogEntryRepository', array('setDefaultQuerySettings'), array($objectManager));
+               $subject->expects($this->once())->method('setDefaultQuerySettings')->with($querySettings);
                $subject->initializeObject();
        }
-
 }
index 0b414e8..f08cedc 100644 (file)
@@ -25,31 +25,20 @@ namespace TYPO3\CMS\Belog\Tests\Unit\Domain\Repository;
  ***************************************************************/
 
 /**
- * Testcase
- *
- * @author Oliver Klee <typo3-coding@oliverklee.de>
+ * Test case
  */
-class WorkspaceRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings
-        */
-       protected $querySettings = NULL;
-
-       public function setUp() {
-               $this->querySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
-               $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->objectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface')->will($this->returnValue($this->querySettings));
-       }
+class WorkspaceRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
         */
        public function initializeObjectSetsRespectStoragePidToFalse() {
-               $this->querySettings->expects($this->atLeastOnce())->method('setRespectStoragePage')->with(FALSE);
-               $fixture = $this->getMock('TYPO3\\CMS\\Belog\\Domain\\Repository\\WorkspaceRepository', array('setDefaultQuerySettings'), array($this->objectManager));
-               $fixture->expects($this->once())->method('setDefaultQuerySettings')->with($this->querySettings);
-               $fixture->initializeObject();
+               $querySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
+               $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
+               $objectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface')->will($this->returnValue($querySettings));
+               $querySettings->expects($this->atLeastOnce())->method('setRespectStoragePage')->with(FALSE);
+               $subject = $this->getMock('TYPO3\\CMS\\Belog\\Domain\\Repository\\WorkspaceRepository', array('setDefaultQuerySettings'), array($objectManager));
+               $subject->expects($this->once())->method('setDefaultQuerySettings')->with($querySettings);
+               $subject->initializeObject();
        }
-
 }
index 39c9ed9..8f782b8 100644 (file)
@@ -27,11 +27,9 @@ namespace TYPO3\CMS\Beuser\Tests\Unit\Domain\Model;
  ***************************************************************/
 
 /**
- * Test case for class \TYPO3\CMS\Beuser\Domain\Model\BackendUser
- *
- * @author Felix Kopp <felix-source@phorax.com>
+ * Test case
  */
-class BackendUserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class BackendUserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Beuser\Domain\Model\BackendUser
index 11f15ca..da17b49 100644 (file)
@@ -28,10 +28,8 @@ namespace TYPO3\CMS\Beuser\Tests\Unit\Domain\Model;
 
 /**
  * Test case for class \TYPO3\CMS\Beuser\Domain\Model\Demand
- *
- * @author Felix Kopp <felix-source@phorax.com>
  */
-class DemandTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class DemandTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Beuser\Domain\Model\Demand
index f8bb58a..97c9098 100644 (file)
@@ -25,27 +25,15 @@ namespace TYPO3\CMS\Beuser\Tests\Unit\Domain\Repository;
  ***************************************************************/
 
 /**
- * Testcase for the \TYPO3\CMS\Beuser\Domain\Repository\BackendUserRepository class.
- *
- * @author Felix Kopp <felix-source@phorax.com>
+ * Test case
  */
-class BackendUserRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
-
-       /**
-        * @var \TYPO3\CMS\Beuser\Domain\Repository\BackendUserRepository
-        */
-       protected $fixture;
-
-       public function setUp() {
-               $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->fixture = new \TYPO3\CMS\Beuser\Domain\Repository\BackendUserRepository($this->objectManager);
-       }
+class BackendUserRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
         */
        public function classCanBeInstantiated() {
-
+               $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface', array(), array(), '', FALSE);
+               new \TYPO3\CMS\Beuser\Domain\Repository\BackendUserRepository($objectManager);
        }
-
 }
index 8751981..3023258 100644 (file)
@@ -25,27 +25,15 @@ namespace TYPO3\CMS\Beuser\Tests\Unit\Domain\Repository;
  ***************************************************************/
 
 /**
- * Testcase for the \TYPO3\CMS\Beuser\Domain\Repository\BackendUserSessionRepository class.
- *
- * @author Felix Kopp <felix-source@phorax.com>
+ * Test case
  */
-class BackendUserSessionRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
-
-       /**
-        * @var \TYPO3\CMS\Beuser\Domain\Repository\BackendUserSessionRepository
-        */
-       protected $fixture;
-
-       public function setUp() {
-               $this->objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
-               $this->fixture = new \TYPO3\CMS\Beuser\Domain\Repository\BackendUserSessionRepository($this->objectManager);
-       }
+class BackendUserSessionRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
         */
        public function classCanBeInstantiated() {
-
+               $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
+               new \TYPO3\CMS\Beuser\Domain\Repository\BackendUserSessionRepository($objectManager);
        }
-
 }
index 1f6bd2b..b57a98c 100644 (file)
@@ -28,11 +28,8 @@ namespace TYPO3\CMS\Beuser\Tests\Unit\Service;
 
 /**
  * Test case
- *
- * @author Felix Kopp <felix-source@phorax.com>
- * @author Nikolas Hagelstein <nikolas.hagelstein@gmail.com>
  */
-class ModuleDataStorageServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class ModuleDataStorageServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
@@ -48,7 +45,16 @@ class ModuleDataStorageServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes
                $GLOBALS['BE_USER']->uc['moduleData'] = array();
 
                /** @var \TYPO3\CMS\Beuser\Service\ModuleDataStorageService $subject */
-               $subject = $this->objectManager->get('TYPO3\\CMS\\Beuser\\Service\\ModuleDataStorageService');
-               $this->assertInstanceOf('TYPO3\\CMS\\Beuser\\Domain\\Model\\ModuleData', $subject->loadModuleData());
+               $subject = $this->getAccessibleMock('TYPO3\\CMS\\Beuser\\Service\\ModuleDataStorageService', array('dummy'), array(), '', FALSE);
+               $objectManagerMock = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManager', array(), array(), '', FALSE);
+               $moduleDataMock = $this->getMock('TYPO3\\CMS\\Beuser\\Domain\\Model\\ModuleData', array(), array(), '', FALSE);
+               $objectManagerMock
+                       ->expects($this->once())
+                       ->method('get')
+                       ->with('TYPO3\\CMS\\Beuser\\Domain\\Model\\ModuleData')
+                       ->will($this->returnValue($moduleDataMock));
+               $subject->_set('objectManager', $objectManagerMock);
+
+               $this->assertSame($moduleDataMock, $subject->loadModuleData());
        }
-}
+}
\ No newline at end of file
index 1d2d1db..8d89a4c 100644 (file)
@@ -62,8 +62,6 @@ abstract class BaseTestCase extends \PHPUnit_Framework_TestCase {
         *         a mock of $originalClassName with access methods added
         *
         * @throws \InvalidArgumentException
-        *
-        * @see \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase::getAccessibleMock
         */
        protected function getAccessibleMock(
                $originalClassName, array $methods = array(), array $arguments = array(), $mockClassName = '',
index b6392a5..eedce99 100644 (file)
@@ -27,11 +27,9 @@ namespace TYPO3\CMS\Core\Tests\Unit\Messaging;
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 /**
- * Testcase for the TYPO3\CMS\Core\Messaging\FlashMessageQueue class.
- *
- * @author Alexander Schnitzler <alex.schnitzler@typovision.de>
+ * Test case
  */
-class FlashMessageQueueTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class FlashMessageQueueTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue|\PHPUnit_Framework_MockObject_MockObject|\Tx_Phpunit_Interface_AccessibleObject
index fa82052..69b82a4 100644 (file)
@@ -26,12 +26,11 @@ namespace TYPO3\CMS\Core\Tests\Unit\Messaging;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
- * Testcase for the TYPO3\CMS\Core\Messaging\FlashMessageService class.
- *
- * @author Alexander Schnitzler <alex.schnitzler@typovision.de>
+ * Test case
  */
-class FlashMessageServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class FlashMessageServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Core\Messaging\FlashMessageService|\PHPUnit_Framework_MockObject_MockObject|\Tx_Phpunit_Interface_AccessibleObject
index 1f71102..54c9b10 100644 (file)
@@ -25,9 +25,9 @@ namespace TYPO3\CMS\Documentation\Tests\Unit\Domain\Model;
  ***************************************************************/
 
 /**
- * Test case for class \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat.
+ * Test case
  */
-class DocumentFormatTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class DocumentFormatTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat
index a16b5ae..ca7cb39 100644 (file)
@@ -25,9 +25,9 @@ namespace TYPO3\CMS\Documentation\Tests\Unit\Domain\Model;
  ***************************************************************/
 
 /**
- * Test case for class \TYPO3\CMS\Documentation\Domain\Model\Document.
+ * Test case
  */
-class DocumentTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class DocumentTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Documentation\Domain\Model\Document
index 80944a9..f208abd 100644 (file)
@@ -25,9 +25,9 @@ namespace TYPO3\CMS\Documentation\Tests\Unit\Domain\Model;
  ***************************************************************/
 
 /**
- * Test case for class \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation.
+ * Test case
  */
-class DocumentTranslationTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class DocumentTranslationTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation
index 177f7e6..c00ad92 100644 (file)
@@ -23,12 +23,12 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\ContentObject\Menu;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
- * Testcase for TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject
+ * Test case
  *
- * @author Stefan Galinski <stefan.galinski@gmail.com>
  */
-class AbstractMenuContentObjectTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class AbstractMenuContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject
index e9c181c..10163e5 100644 (file)
@@ -32,7 +32,7 @@ namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;
  *
  * @author Wouter Wolters <typo3@wouterwolters.nl>
  */
-class ExtensionTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class ExtensionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Lang\Domain\Model\Extension
index 0b5857d..a3e0c90 100644 (file)
@@ -27,11 +27,9 @@ namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;
  ***************************************************************/
 
 /**
- * Testcase LanguageSelectionForm
- *
- * @author Wouter Wolters <typo3@wouterwolters.nl>
+ * Test case
  */
-class LanguageSelectionFormTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class LanguageSelectionFormTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm
index 98fee7a..03d1ff3 100644 (file)
@@ -28,11 +28,9 @@ namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;
  ***************************************************************/
 
 /**
- * Testcase for Language
- *
- * @author Wouter Wolters <typo3@wouterwolters.nl>
+ * Test case for Language
  */
-class LanguageTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class LanguageTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Lang\Domain\Model\Language
index 2ee196d..b0765b2 100644 (file)
@@ -28,11 +28,9 @@ namespace TYPO3\CMS\Lang\Tests\Unit\Domain\Model;
  ***************************************************************/
 
 /**
- * Testcase for UpdateTranslationForm
- *
- * @author Wouter Wolters <typo3@wouterwolters.nl>
+ * Test case
  */
-class UpdateTranslationFormTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
+class UpdateTranslationFormTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @var \TYPO3\CMS\Lang\Domain\Model\UpdateTranslationForm