[TASK] Clean up Unit tests in extbase
authorMarkus Günther <mail@markus-guenther.de>
Sat, 9 Feb 2013 20:37:12 +0000 (21:37 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 9 Feb 2013 22:26:41 +0000 (23:26 +0100)
We had many tests in extbase that are incomplete.
These tests has been incomplete for several years.

Some test has been removed also in TYPO3 flow.

Change-Id: I75a20d1a1bac6fdeca79067acd5d00ad2db9f964
Fixes: #45330
Releases: 6.1
Reviewed-on: https://review.typo3.org/18169
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Reviewed-by: Oliver Klee
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/extbase/Tests/Unit/Configuration/AbstractConfigurationManagerTest.php
typo3/sysext/extbase/Tests/Unit/Configuration/BackendConfigurationManagerTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ActionControllerTest.php
typo3/sysext/extbase/Tests/Unit/Object/Container/ClassInfoFactoryTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/PersistenceManagerTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbBackendTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BeforeExtbase14/TextValidatorTest.php

index be6eb42..c6572d8 100644 (file)
@@ -461,55 +461,6 @@ class AbstractConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas
        /**
         * @test
         */
-       public function getConfigurationParsesCObjectsForStoragePid() {
-               $this->markTestIncomplete('This can\'t be tested as we currently cannot mock the FE environment');
-               $storagePidSettings = array(
-                       'cObject' => array(
-                               'value' => '8,3',
-                               '_typoScriptNodeValue' => 'TEXT'
-                       )
-               );
-               $storagePidSettingsConverted = array(
-                       'cObject' => 'TEXT',
-                       'cObject.' => array(
-                               'value' => '8,3'
-                       )
-               );
-               $pluginConfiguration = ($pluginConfigurationConverted = $this->testPluginConfiguration);
-               $pluginConfiguration['persistence']['storagePid'] = $storagePidSettings;
-               $pluginConfigurationConverted['persistence']['storagePid'] = $storagePidSettingsConverted;
-               $abstractConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('getSwitchableControllerActions', 'getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getRecursiveStoragePids'));
-               $this->mockTypoScriptService->expects($this->any())->method('convertPlainArrayToTypoScriptArray')->with($storagePidSettings)->will($this->returnValue($storagePidSettingsConverted));
-               $this->mockTypoScriptService->expects($this->atLeastOnce())->method('convertTypoScriptArrayToPlainArray')->with($this->testTypoScriptSetup['config.']['tx_extbase.'])->will($this->returnValue($this->testTypoScriptSetupConverted['config']['tx_extbase']));
-               $abstractConfigurationManager->injectTypoScriptService($this->mockTypoScriptService);
-               $abstractConfigurationManager->expects($this->once())->method('getTypoScriptSetup')->will($this->returnValue($this->testTypoScriptSetup));
-               $abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($pluginConfiguration));
-               $abstractConfigurationManager->expects($this->once())->method('getSwitchableControllerActions')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue(NULL));
-               $expectedResult = array(
-                       'settings' => array(
-                               'setting1' => 'overriddenValue1',
-                               'setting2' => 'value2',
-                               'setting3' => 'additionalValue'
-                       ),
-                       'view' => array(
-                               'viewSub' => array(
-                                       'key1' => 'overridden',
-                                       'key2' => 'value2',
-                                       'key3' => 'new key'
-                               )
-                       ),
-                       'persistence' => array(
-                               'storagePid' => '8,3'
-                       ),
-                       'controllerConfiguration' => NULL
-               );
-               $actualResult = $abstractConfigurationManager->getConfiguration('CurrentExtensionName', 'CurrentPluginName');
-               $this->assertEquals($expectedResult, $actualResult);
-       }
-
-       /**
-        * @test
-        */
        public function getContentObjectReturnsNullIfNoContentObjectHasBeenSet() {
                $this->assertNull($this->abstractConfigurationManager->getContentObject());
        }
index fa19d9f..428763d 100644 (file)
@@ -65,13 +65,6 @@ class BackendConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Base
        /**
         * @test
         */
-       public function getTypoScriptSetupCanBeTested() {
-               $this->markTestIncomplete('This method can\'t be tested with the current TYPO3 version, because we can\'t mock objects returned from TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance().');
-       }
-
-       /**
-        * @test
-        */
        public function getCurrentPageIdReturnsPageIdFromGet() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::_GETset(array('id' => 123));
                $expectedResult = 123;
index 5821b09..a072313 100644 (file)
@@ -493,14 +493,6 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        }
 
        /**
-        * @test
-        * @author Christopher Hlubek <hlubek@networkteam.com>
-        */
-       public function defaultErrorActionCallsGetErrorFlashMessageAndPutsFlashMessage() {
-               $this->markTestIncomplete('To be implemented');
-       }
-
-       /**
         * Data Provider for checkRequestHashDoesNotThrowExceptionInNormalOperations
         *
         * @return array
@@ -586,4 +578,4 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        }
 }
 
-?>
\ No newline at end of file
+?>
index 6bd5a32..398a7e3 100644 (file)
@@ -68,13 +68,6 @@ class ClassInfoFactoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $classInfo = $this->classInfoFactory->buildClassInfoFromClassName('TYPO3\\CMS\\Extbase\\Tests\\Fixture\\ClassWithInjectProperties');
                $this->assertEquals(array('secondDummyClass' => 'TYPO3\\CMS\\Extbase\\Tests\\Fixture\\SecondDummyClass'), $classInfo->getInjectProperties());
        }
-
-       /**
-        * @test
-        */
-       public function moreTestsNeedToBeWritten() {
-               $this->markTestIncomplete('More tests need to be written!');
-       }
 }
 
 ?>
\ No newline at end of file
index 4f5e8a8..08fe72c 100644 (file)
@@ -94,20 +94,6 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $persistenceManager->injectSession($persistenceSession);
                $persistenceManager->persistAll();
        }
-
-       /**
-        * @test
-        */
-       public function persistAllAddsRemovedObjectsFromRepositoriesToBackendsDeletedObjects() {
-               $this->markTestIncomplete();
-       }
-
-       /**
-        * @test
-        */
-       public function persistAllAddsAddedObjectsFromRepositoriesToBackendsAggregateRootObjects() {
-               $this->markTestIncomplete();
-       }
 }
 
 ?>
\ No newline at end of file
index 14b85c4..0e86fd6 100644 (file)
@@ -62,35 +62,6 @@ class Typo3DbBackendTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        /**
         * @test
         */
-       public function getStatementWorksWithMinimalisticQueryObjectModel() {
-               $this->markTestIncomplete();
-       }
-
-       /**
-        * @test
-        */
-       public function getStatementWorksWithBasicEqualsCondition() {
-               $this->markTestIncomplete();
-       }
-
-       /**
-        * @test
-        * @expectedException \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\BadConstraintException
-        */
-       public function countRowsWithStatementConstraintResultsInAnException() {
-               $this->markTestIncomplete();
-       }
-
-       /**
-        * @test
-        */
-       public function joinStatementGenerationWorks() {
-               $this->markTestIncomplete();
-       }
-
-       /**
-        * @test
-        */
        public function addSysLanguageStatementWorksForDefaultLanguage() {
                $table = uniqid('tx_coretest_table');
                $GLOBALS['TCA'][$table]['ctrl'] = array(
index d12e82d..e8ad7ee 100644 (file)
@@ -74,15 +74,6 @@ Ke kille Minutt d\'Kirmes net. Hir Wand Lann Gaas da, wär hu Heck Gart zën
        /**
         * @test
         */
-       public function textValidatorReturnsFalseForAStringWithPercentEncodedHtml() {
-               $this->markTestIncomplete('The text validator currently allows percent encoded HTML!');
-               $textValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\TextValidator', array('addError'), array(), '', FALSE);
-               $this->assertFalse($textValidator->isValid('%3cspan style="color: #BBBBBB;"%3ea nice text%3c/span%3e'));
-       }
-
-       /**
-        * @test
-        */
        public function textValidatorCreatesTheCorrectErrorIfTheSubjectContainsHtmlEntities() {
                $textValidator = $this->getMock('TYPO3\\CMS\\Extbase\\Validation\\Validator\\TextValidator', array('addError'), array(), '', FALSE);
                $textValidator->expects($this->once())->method('addError')->with('The given subject was not a valid text (e.g. contained XML tags).', 1221565786);