[TASK] Reduce memory footprint of unit tests 28/27528/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 10 Feb 2014 17:15:24 +0000 (18:15 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 10 Feb 2014 19:36:54 +0000 (20:36 +0100)
Running the whole unit test suite on cli can eat up a significant
amount of memory. Most of that can not be mitigated due to phpunit
itself, but we can at least hint the PHP garbage collection by
unsetting test class properties in tearDown().

The patch introduces a generic tearDown() method that reflects the
test class and unsets all temporary properties of the class. In
effect, tests do not need to take care of unsetting properties.

The patch removes all tearDown() methods that only unset() stuff
and keeps others that do additional things but adds a call to
parent::tearDown(). Private properties are changed to protected,
so parent::tearDown can reach them. The additional computing
effort of the reflection is insignificant, the suite is nearly as
fast as before.

Results:
php 5.3: 1056MB -> 851MB
php 5.4: 870MB -> 670MB
php 5.5.: 876MB -> 674MB

Resolves: #55850
Related: #51436
Releases: 6.2
Change-Id: Ie665c53a3ab35e4808677e483d2099e0511c393f
Reviewed-on: https://review.typo3.org/27528
Reviewed-by: Helmut Hummel
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
172 files changed:
typo3/sysext/backend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php
typo3/sysext/backend/Tests/Unit/Form/Element/InlineElementTest.php
typo3/sysext/backend/Tests/Unit/Form/ElementConditionMatcherTest.php
typo3/sysext/backend/Tests/Unit/Module/ModuleControllerTest.php
typo3/sysext/backend/Tests/Unit/Tree/Pagetree/DataProviderTest.php
typo3/sysext/backend/Tests/Unit/Tree/TreeNodeCollectionTest.php
typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php
typo3/sysext/backend/Tests/Unit/Utility/IconUtilityTest.php
typo3/sysext/backend/Tests/Unit/View/BackendLayout/DataProviderCollectionTest.php
typo3/sysext/backend/Tests/Unit/View/BackendLayoutViewTest.php
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/Unit/Authentication/AbstractUserAuthenticationTest.php
typo3/sysext/core/Tests/Unit/Authentication/BackendUserAuthenticationTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/RedisBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/Typo3DatabaseBackendTest.php
typo3/sysext/core/Tests/Unit/Category/CategoryRegistryTest.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/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcherTest.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/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/HtmlParserTest.php
typo3/sysext/core/Tests/Unit/Html/RteHtmlParserTest.php
typo3/sysext/core/Tests/Unit/Imaging/GraphicalFunctionsTest.php
typo3/sysext/core/Tests/Unit/Localization/Parser/LocallangXmlParserTest.php
typo3/sysext/core/Tests/Unit/Localization/Parser/XliffParserTest.php
typo3/sysext/core/Tests/Unit/Log/LogManagerTest.php
typo3/sysext/core/Tests/Unit/Log/Writer/DatabaseTest.php
typo3/sysext/core/Tests/Unit/Mail/MailerTest.php
typo3/sysext/core/Tests/Unit/Mail/SwiftMailerAdapterTest.php
typo3/sysext/core/Tests/Unit/Resource/Driver/DriverRegistryTest.php
typo3/sysext/core/Tests/Unit/Resource/Driver/LocalDriverTest.php
typo3/sysext/core/Tests/Unit/Resource/FileReferenceTest.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/ResourceFactoryTest.php
typo3/sysext/core/Tests/Unit/Resource/ResourceStorageTest.php
typo3/sysext/core/Tests/Unit/Resource/Service/FrontendContentAdapterServiceTest.php
typo3/sysext/core/Tests/Unit/Resource/Utility/FileExtensionFilterTest.php
typo3/sysext/core/Tests/Unit/TypoScript/Parser/TypoScriptParserTest.php
typo3/sysext/core/Tests/Unit/TypoScript/TemplateServiceTest.php
typo3/sysext/core/Tests/Unit/Utility/ClientUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/ExtensionManagementUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/MailUtilityTest.php
typo3/sysext/core/Tests/UnitTestCase.php
typo3/sysext/dbal/Tests/Unit/Database/DatabaseConnectionMssqlTest.php
typo3/sysext/dbal/Tests/Unit/Database/DatabaseConnectionOracleTest.php
typo3/sysext/dbal/Tests/Unit/Database/DatabaseConnectionPostgresqlTest.php
typo3/sysext/dbal/Tests/Unit/Database/DatabaseConnectionTest.php
typo3/sysext/dbal/Tests/Unit/Database/SqlParserTest.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/extbase/Tests/Unit/Core/BootstrapTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Model/BackendUserGroupTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Model/BackendUserTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Model/CategoryTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Model/FileMountTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Model/FrontendUserGroupTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Model/FrontendUserTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Repository/CategoryRepositoryTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Repository/FileMountRepositoryTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandManagerTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php
typo3/sysext/extbase/Tests/Unit/Object/Container/ClassInfoFactoryTest.php
typo3/sysext/extbase/Tests/Unit/Object/Container/ContainerTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryFactoryTest.php
typo3/sysext/extbase/Tests/Unit/Property/MapperTest.php
typo3/sysext/extbase/Tests/Unit/Utility/LocalizationUtilityTest.php
typo3/sysext/extensionmanager/Tests/Unit/Task/UpdateExtensionListTaskTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/FileHandlingUtilityTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/InstallUtilityTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/ListUtilityTest.php
typo3/sysext/felogin/Tests/Unit/Controller/FrontendLoginControllerTest.php
typo3/sysext/fluid/Tests/Unit/Core/Parser/ParsingStateTest.php
typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/TemplateVariableContainerTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestBuilderTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestHandlerTest.php
typo3/sysext/fluid/Tests/Unit/View/StandaloneViewTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/IfAuthenticatedViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/IfHasRoleViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/DateViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Security/IfAuthenticatedViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Widget/Controller/PaginateControllerTest.php
typo3/sysext/form/Tests/Unit/Domain/Factory/TypoScriptFactoryTest.php
typo3/sysext/form/Tests/Unit/Filter/AlphabeticFilterTest.php
typo3/sysext/form/Tests/Unit/Filter/AlphanumericFilterTest.php
typo3/sysext/form/Tests/Unit/Filter/CurrencyFilterTest.php
typo3/sysext/form/Tests/Unit/Filter/DigitFilterTest.php
typo3/sysext/form/Tests/Unit/Filter/IntegerFilterTest.php
typo3/sysext/form/Tests/Unit/Filter/LowerCaseFilterTest.php
typo3/sysext/form/Tests/Unit/Filter/RegExpFilterTest.php
typo3/sysext/form/Tests/Unit/Filter/RemoveXssFilterTest.php
typo3/sysext/form/Tests/Unit/Filter/StripNewLinesFilterTest.php
typo3/sysext/form/Tests/Unit/Filter/TitleCaseFilterTest.php
typo3/sysext/form/Tests/Unit/Filter/TrimFilterTest.php
typo3/sysext/form/Tests/Unit/Filter/UpperCaseFilterTest.php
typo3/sysext/form/Tests/Unit/PostProcess/MailPostProcessorTest.php
typo3/sysext/form/Tests/Unit/Validation/AlphabeticValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/AlphanumericValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/BetweenValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/DateValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/DigitValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/EmailValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/EqualsValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/FileAllowedTypesValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/FileMaximumSizeValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/FileMinimumSizeValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/FloatValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/GreaterThanValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/InArrayValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/IntegerValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/IpValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/LengthValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/LessThanValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/RegExpValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/RequiredValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/UriValidatorTest.php
typo3/sysext/frontend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/FilesContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php
typo3/sysext/frontend/Tests/Unit/MediaWizard/MediaWizardProviderTest.php
typo3/sysext/frontend/Tests/Unit/Page/CacheHashCalculatorTest.php
typo3/sysext/frontend/Tests/Unit/Page/PageRepositoryTest.php
typo3/sysext/frontend/Tests/Unit/Plugin/AbstractPluginTest.php
typo3/sysext/indexed_search/Tests/Unit/IndexerTest.php
typo3/sysext/install/Tests/Unit/Controller/Action/Ajax/ExtensionCompatibilityTesterTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/AbstractNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/FileNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/LinkNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/RootNodeTest.php
typo3/sysext/install/Tests/Unit/Service/SqlSchemaMigrationServiceTest.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
typo3/sysext/lowlevel/Tests/Unit/Utility/ArrayBrowserTest.php
typo3/sysext/rsaauth/Tests/Unit/Backend/CommandLineBackendTest.php
typo3/sysext/rsaauth/Tests/Unit/Backend/PhpBackendTest.php
typo3/sysext/rsaauth/Tests/Unit/KeypairTest.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/scheduler/Tests/Unit/Controller/SchedulerModuleControllerTest.php
typo3/sysext/scheduler/Tests/Unit/CronCommand/CronCommandTest.php

index 04f53e6..7717a0f 100644 (file)
@@ -34,17 +34,17 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var array
         */
-       private $rootline;
+       protected $rootline;
 
        /**
         * @var \TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher
         */
-       private $matchCondition;
+       protected $matchCondition;
 
        /**
         * @var string
         */
-       private $testTableName;
+       protected $testTableName;
 
        public function setUp() {
                $this->testTableName = 'TYPO3\\CMS\\Backend\\Configuration\\TypoScript\\ConditionMatching\\ConditionMatcher_testTable';
@@ -55,11 +55,6 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->matchCondition = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Configuration\\TypoScript\\ConditionMatching\\ConditionMatcher');
        }
 
-       public function tearDown() {
-               unset($this->matchCondition);
-               unset($GLOBALS[$this->testGlobalNamespace]);
-       }
-
        private function setUpBackend() {
                $this->rootline = array(
                        2 => array('uid' => 121, 'pid' => 111),
index b96f38d..fc4ae81 100644 (file)
@@ -45,13 +45,6 @@ class InlineElementTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down this test case.
-        */
-       protected function tearDown() {
-               unset($this->fixture);
-       }
-
-       /**
         * @param array $arguments
         * @param array $expectedInlineStructure
         * @param array $expectedInlineNames
index c9b2be1..064b0ea 100644 (file)
@@ -42,13 +42,6 @@ class ElementConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down this test case.
-        */
-       protected function tearDown() {
-               unset($this->fixture);
-       }
-
-       /**
         * Returns data sets for the test matchConditionStrings
         * Each dataset is an array with the following elements:
         * - the condition string
index afd71e4..dd11dda 100644 (file)
@@ -43,10 +43,6 @@ class ModuleControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->moduleController = $this->getAccessibleMock('TYPO3\\CMS\\Backend\\Module\\ModuleController', array('getLanguageService'), array(), '', FALSE);
        }
 
-       protected function tearDown() {
-               unset($this->moduleController);
-       }
-
        /**
         * @test
         */
index 18c16ca..4520791 100644 (file)
@@ -42,10 +42,6 @@ class DataProviderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = new \TYPO3\CMS\Backend\Tree\Pagetree\DataProvider();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index f1d2bba..a286a72 100644 (file)
@@ -31,14 +31,6 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Tree;
  */
 class TreeNodeCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
-       public function setUp() {
-
-       }
-
-       public function tearDown() {
-
-       }
-
        /**
         * @test
         */
index 00bd73b..4954400 100644 (file)
@@ -36,16 +36,12 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Backend\Utility\BackendUtility
         */
-       private $fixture;
+       protected $fixture;
 
        public function setUp() {
                $this->fixture = new BackendUtility();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        ///////////////////////////////////////
        // Tests concerning calcAge
        ///////////////////////////////////////
index 3b6c208..b416a7e 100644 (file)
@@ -80,10 +80,6 @@ class IconUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->mockRecord['bodytext'] = '';
        }
 
-       public function tearDown() {
-               unset($this->mockRecord);
-       }
-
        //////////////////////////////////////////
        // Tests concerning imagemake
        //////////////////////////////////////////
index 80321ad..1aa267c 100644 (file)
@@ -47,13 +47,6 @@ class DataProviderCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down this test case.
-        */
-       protected function tearDown() {
-               unset($this->dataProviderCollection);
-       }
-
-       /**
         * @test
         * @expectedException \UnexpectedValueException
         */
index dfacb02..8ed47f6 100644 (file)
@@ -51,13 +51,6 @@ class BackendLayoutViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down this test case.
-        */
-       protected function tearDown() {
-               unset($this->backendLayoutView);
-       }
-
-       /**
         * @param boolean|string $expected
         * @param array $page
         * @param array $rootLine
index 07a6573..10e5448 100644 (file)
@@ -40,10 +40,6 @@ class ConstraintTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = new \TYPO3\CMS\Belog\Domain\Model\Constraint();
        }
 
-       public function tearDown() {
-               unset($this->subject);
-       }
-
        /**
         * @test
         */
index 6eefc6c..df7512a 100644 (file)
@@ -40,10 +40,6 @@ class LogEntryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture = new \TYPO3\CMS\Belog\Domain\Model\LogEntry();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index 0fccc24..0e19d85 100644 (file)
@@ -42,10 +42,6 @@ class HistoryEntryRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestC
                $this->objectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface')->will($this->returnValue($this->querySettings));
        }
 
-       public function tearDown() {
-               unset($this->querySettings, $this->objectManager);
-       }
-
        /**
         * @test
         */
index 2590146..5a0087a 100644 (file)
@@ -41,10 +41,6 @@ class LogEntryRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $this->objectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface')->will($this->returnValue($this->querySettings));
        }
 
-       public function tearDown() {
-               unset($this->querySettings, $this->objectManager);
-       }
-
        /**
         * @test
         */
index cf8149b..0b414e8 100644 (file)
@@ -42,10 +42,6 @@ class WorkspaceRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $this->objectManager->expects($this->any())->method('get')->with('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface')->will($this->returnValue($this->querySettings));
        }
 
-       public function tearDown() {
-               unset($this->querySettings, $this->objectManager);
-       }
-
        /**
         * @test
         */
index df9efe7..39c9ed9 100644 (file)
@@ -42,10 +42,6 @@ class BackendUserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture = new \TYPO3\CMS\Beuser\Domain\Model\BackendUser();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index d10731c..11f15ca 100644 (file)
@@ -42,10 +42,6 @@ class DemandTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture = new \TYPO3\CMS\Beuser\Domain\Model\Demand();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index 1bac118..f8bb58a 100644 (file)
@@ -41,11 +41,6 @@ class BackendUserRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCa
                $this->fixture = new \TYPO3\CMS\Beuser\Domain\Repository\BackendUserRepository($this->objectManager);
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-               unset($this->objectManager);
-       }
-
        /**
         * @test
         */
index 1f9f673..8751981 100644 (file)
@@ -41,11 +41,6 @@ class BackendUserSessionRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas
                $this->fixture = new \TYPO3\CMS\Beuser\Domain\Repository\BackendUserSessionRepository($this->objectManager);
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-               unset($this->objectManager);
-       }
-
        /**
         * @test
         */
index f2a01eb..1283b24 100644 (file)
@@ -43,10 +43,6 @@ class ModuleDataStorageServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes
                $this->fixture = $this->objectManager->get('TYPO3\\CMS\\Beuser\\Service\\ModuleDataStorageService');
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index 6c1023b..4edfdff 100644 (file)
@@ -49,6 +49,7 @@ class AbstractUserAuthenticationTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                foreach ($this->globals as $key => $value) {
                        $GLOBALS[$key] = unserialize($value);
                }
+               parent::tearDown();
        }
 
        ////////////////////////////////////
index 09d7003..9c480c5 100644 (file)
@@ -58,7 +58,7 @@ class BackendUserAuthenticationTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
         */
-       private $fixture = NULL;
+       protected $fixture = NULL;
 
        public function setUp() {
                // reset hooks
@@ -69,6 +69,7 @@ class BackendUserAuthenticationTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function tearDown() {
                unset($this->fixture);
                \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::purgeInstances();
+               parent::tearDown();
        }
 
        /////////////////////////////////////////
index 10802cb..c85d12f 100644 (file)
@@ -99,6 +99,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                if ($this->backend instanceof \TYPO3\CMS\Core\Cache\Backend\RedisBackend) {
                        $this->backend->flush();
                }
+               parent::tearDown();
        }
 
        /**
index 89f5021..994d377 100644 (file)
@@ -97,6 +97,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function tearDown() {
                $GLOBALS['TYPO3_DB']->sql_query('DROP TABLE IF EXISTS ' . $this->testingCacheTable . ';');
                $GLOBALS['TYPO3_DB']->sql_query('DROP TABLE IF EXISTS ' . $this->testingTagsTable . ';');
+               parent::tearDown();
        }
 
        /**
index e4017d7..951ca1d 100644 (file)
@@ -63,14 +63,6 @@ class CategoryRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down this test suite.
-        */
-       protected function tearDown() {
-               unset($this->tables);
-               unset($this->fixture);
-       }
-
-       /**
         * @test
         */
        public function doesAddReturnTrueOnDefinedTable() {
index 32dbabe..2c6976d 100644 (file)
@@ -34,16 +34,12 @@ class CharsetConverterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Core\Charset\CharsetConverter
         */
-       private $fixture = NULL;
+       protected $fixture = NULL;
 
        public function setUp() {
                $this->fixture = new \TYPO3\CMS\Core\Charset\CharsetConverter();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        ////////////////////////////
        // Tests concerning substr
        ////////////////////////////
index 288c616..0946235 100644 (file)
@@ -73,17 +73,6 @@ class RecordCollectionRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
        }
 
        /**
-        * Cleans up this test case.
-        */
-       protected function tearDown() {
-               unset($this->databaseMock);
-               unset($this->fixture);
-               unset($this->getSingleRowCallbackReturnValue);
-               unset($this->getRowsCallbackReturnValue);
-               unset($this->testTableName);
-       }
-
-       /**
         * @test
         */
        public function doesFindByUidReturnNull() {
index a772bdf..bfccb53 100644 (file)
@@ -58,6 +58,7 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                foreach ($this->testFilesToDelete as $absoluteFileName) {
                        \TYPO3\CMS\Core\Utility\GeneralUtility::unlink_tempfile($absoluteFileName);
                }
+               parent::tearDown();
        }
 
        /**
index 52f318e..8b4201a 100644 (file)
@@ -52,7 +52,7 @@ class AbstractConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function tearDown() {
                Fixtures\GeneralUtilityFixture::setApplicationContext($this->backupApplicationContext);
-               unset($this->backupApplicationContext);
+               parent::tearDown();
        }
 
        /**
index 2a150d2..7eda997 100644 (file)
@@ -43,7 +43,6 @@ class ClassLoaderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        protected $fakedExtensions = array();
 
-
        /**
         * @var \TYPO3\CMS\Core\Core\ClassLoader
         */
@@ -92,6 +91,7 @@ class ClassLoaderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function tearDown() {
                $this->classLoader->injectClassAliasMap($this->orinalClassAliasMap);
+               parent::tearDown();
        }
 
        /**
index 1fd5237..29d2459 100644 (file)
@@ -48,15 +48,6 @@ class SystemEnvironmentBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tear down
-        *
-        * @return void
-        */
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
-       /**
         * Data provider for 'fileDenyPatternMatchesPhpExtension' test case.
         *
         * @return array
index 1549b7c..62c2385 100644 (file)
@@ -39,12 +39,12 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Core\DataHandling\DataHandler
         */
-       private $fixture;
+       protected $fixture;
 
        /**
         * @var \TYPO3\CMS\Core\Authentication\BackendUserAuthentication a mock logged-in back-end user
         */
-       private $backEndUser;
+       protected $backEndUser;
 
        public function setUp() {
                $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
@@ -55,7 +55,7 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        public function tearDown() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
-               unset($this->fixture->BE_USER, $this->fixture, $this->backEndUser);
+               parent::tearDown();
        }
 
        //////////////////////////////////////
index 0431a86..65cc001 100644 (file)
@@ -51,7 +51,7 @@ class DatabaseConnectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        public function tearDown() {
                $this->fixture->sql_query('DROP TABLE ' . $this->testTable . ';');
-               unset($this->fixture);
+               parent::tearDown();
        }
 
        //////////////////////////////////////////////////
index b745dad..d3bba07 100644 (file)
@@ -34,7 +34,7 @@ class PreparedStatementTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Database\DatabaseConnection
         */
-       private $databaseStub;
+       protected $databaseStub;
 
        /**
         * Create a new database mock object for every test
index 8385a8e..26e9e85 100644 (file)
@@ -33,16 +33,12 @@ class SqlParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Core\Database\SqlParser|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
         */
-       private $fixture;
+       protected $fixture;
 
        public function setUp() {
                $this->fixture = $this->getAccessibleMock('\\TYPO3\\CMS\\Core\\Database\\SqlParser', array('dummy'));
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * Regression test
         *
index a352b43..461c13c 100644 (file)
@@ -40,10 +40,6 @@ class JavaScriptEncoderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = new \TYPO3\CMS\Core\Encoder\JavaScriptEncoder();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * Data provider for encodeEncodesCorrectly.
         *
index 05018f7..e1b6de6 100644 (file)
@@ -34,7 +34,7 @@ class DebugExceptionHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Core\Error\DebugExceptionHandler|\PHPUnit_Framework_MockObject_MockObject
         */
-       private $fixture = NULL;
+       protected $fixture = NULL;
 
        /**
         * Sets up this test case.
@@ -45,13 +45,6 @@ class DebugExceptionHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down this test case.
-        */
-       protected function tearDown() {
-               unset($this->fixture);
-       }
-
-       /**
         * @test
         */
        public function echoExceptionWebEscapesExceptionMessage() {
index c161f46..c9772bc 100644 (file)
@@ -34,7 +34,7 @@ class ProductionExceptionHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
        /**
         * @var \TYPO3\CMS\Core\Error\ProductionExceptionHandler|\PHPUnit_Framework_MockObject_MockObject
         */
-       private $fixture = NULL;
+       protected $fixture = NULL;
 
        /**
         * Sets up this test case.
@@ -45,13 +45,6 @@ class ProductionExceptionHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
        }
 
        /**
-        * Tears down this test case.
-        */
-       protected function tearDown() {
-               unset($this->fixture);
-       }
-
-       /**
         * @test
         */
        public function echoExceptionWebEscapesExceptionMessage() {
index 81d50aa..8332a19 100644 (file)
@@ -34,17 +34,12 @@ class AbstractFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Core\Tests\Unit\FormProtection\Fixtures\FormProtectionTesting
         */
-       private $fixture;
+       protected $fixture;
 
        public function setUp() {
                $this->fixture = new \TYPO3\CMS\Core\Tests\Unit\FormProtection\Fixtures\FormProtectionTesting();
        }
 
-       public function tearDown() {
-               $this->fixture->__destruct();
-               unset($this->fixture);
-       }
-
        /////////////////////////////////////////
        // Tests concerning the basic functions
        /////////////////////////////////////////
index d249c82..81776ee 100644 (file)
@@ -61,7 +61,7 @@ class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        public function tearDown() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
-               $this->subject->__destruct();
+               parent::tearDown();
        }
 
        //////////////////////
index 90dca44..6456ec4 100644 (file)
@@ -38,6 +38,7 @@ class FormProtectionFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        public function tearDown() {
                \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::purgeInstances();
+               parent::tearDown();
        }
 
        /////////////////////////
index 91e06b9..95b4769 100644 (file)
@@ -37,30 +37,15 @@ class InstallToolFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        protected $fixture;
 
        /**
-        * @var array Backup of $_SESSION
-        */
-       protected $sessionBackup;
-
-       /**
         * Set up
         */
        public function setUp() {
-               $this->sessionBackup = $_SESSION;
-
                $this->fixture = $this->getAccessibleMock(
                        'TYPO3\\CMS\\Core\\FormProtection\\InstallToolFormProtection',
                        array('dummy')
                );
        }
 
-       /**
-        * Tear down
-        */
-       public function tearDown() {
-               $this->fixture->__destruct();
-               $_SESSION = $this->sessionBackup;
-       }
-
        //////////////////////////////////////////////////////////
        // Tests concerning the reading and saving of the tokens
        //////////////////////////////////////////////////////////
index 826ad3d..c545ddb 100644 (file)
@@ -40,10 +40,6 @@ class HtmlParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = new \TYPO3\CMS\Core\Html\HtmlParser();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * Data provider for substituteMarkerAndSubpartArrayRecursiveResolvesMarkersAndSubpartsArray
         */
index 8ecc9a6..a074a4d 100644 (file)
@@ -34,7 +34,7 @@ class RteHtmlParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Core\Html\RteHtmlParser
         */
-       private $fixture = NULL;
+       protected $fixture = NULL;
 
        public function setUp() {
                $this->fixture = new \TYPO3\CMS\Core\Html\RteHtmlParser();
@@ -47,10 +47,6 @@ class RteHtmlParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                );
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * Data provider for hrTagCorrectlyTransformedOnWayToDataBase
         */
index 9d422c7..dee2817 100644 (file)
@@ -46,15 +46,6 @@ class GraphicalFunctionsTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tear down
-        *
-        * @return void
-        */
-       public function tearDown() {
-               $this->fixture = NULL;
-       }
-
-       /**
         * Dataprovider for getScaleForImage
         *
         * @return array
index b0e0cd0..caaeda1 100644 (file)
@@ -70,11 +70,11 @@ class LocallangXmlParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * Cleans up the environment after running a test.
         */
        public function tearDown() {
-               unset($this->parser);
-                       // Restore locallangXMLOverride and localization format priority
+               // Restore locallangXMLOverride and localization format priority
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'] = $this->locallangXMLOverride;
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['format']['priority'] = $this->l10nPriority;
                \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\LanguageStore')->initialize();
+               parent::tearDown();
        }
 
        /**
index e555aba..bd41ff9 100644 (file)
@@ -77,11 +77,11 @@ class XliffParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * Cleans up the environment after running a test.
         */
        public function tearDown() {
-               unset($this->parser);
-                       // Restore locallangXMLOverride and localization format priority
+               // Restore locallangXMLOverride and localization format priority
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'] = $this->locallangXMLOverride;
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['format']['priority'] = $this->l10nPriority;
                \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\LanguageStore')->initialize();
+               parent::tearDown();
        }
 
        /**
index c5da7b2..369d997 100644 (file)
@@ -44,6 +44,7 @@ class LogManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        public function tearDown() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogManager')->reset();
+               parent::tearDown();
        }
 
        /**
index 3d8c2a4..585f514 100644 (file)
@@ -34,7 +34,7 @@ class DatabaseTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Database\DatabaseConnection
         */
-       private $databaseStub;
+       protected $databaseStub;
 
        /**
         * Create a new database mock object for every test
index 2d7f02f..eebbcee 100644 (file)
@@ -36,21 +36,10 @@ class MailerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        protected $fixture;
 
-       /**
-        * @var array
-        */
-       protected $globalMailSettings;
-
        public function setUp() {
-               $this->globalMailSettings = $GLOBALS['TYPO3_CONF_VARS']['MAIL'];
                $this->fixture = $this->getMock('TYPO3\\CMS\\Core\\Mail\\Mailer', array('noMethodMocked'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-               $GLOBALS['TYPO3_CONF_VARS']['MAIL'] = $this->globalMailSettings;
-       }
-
        //////////////////////////
        // Tests concerning TYPO3\CMS\Core\Mail\Mailer
        //////////////////////////
index 9889843..41baabc 100644 (file)
@@ -40,10 +40,6 @@ class SwiftMailerAdapterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = $this->getAccessibleMock('\\TYPO3\\CMS\\Core\\Mail\\SwiftMailerAdapter', array('dummy'));
        }
 
-       public function tearDown() {
-
-       }
-
        //////////////////////////
        // Tests concerning mail
        //////////////////////////
index f9a18f9..15ce9e5 100644 (file)
@@ -37,7 +37,7 @@ class DriverRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Core\Resource\Driver\DriverRegistry
         */
-       private $fixture;
+       protected $fixture;
 
        public function setUp() {
                $this->initializeFixture();
index a8fa154..18cf42a 100644 (file)
@@ -51,28 +51,31 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
        /**
         * @var array
         */
-       static private $testDirs = array();
+       protected $testDirs = array();
 
-
-       static public function tearDownAfterClass() {
-               foreach (self::$testDirs as $dir) {
+       /**
+        * Tear down
+        */
+       public function tearDown() {
+               foreach ($this->testDirs as $dir) {
                        chmod($dir, 0777);
                        \TYPO3\CMS\Core\Utility\GeneralUtility::rmdir($dir, TRUE);
                }
+               parent::tearDown();
        }
 
        /**
         * Creates a "real" directory for doing tests. This is necessary because some file system properties (e.g. permissions)
         * cannot be reflected by vfsStream, and some methods (like touch()) don't work there either.
         *
-        * Created directories are automatically destroyed by the tearDownAfterClass() method.
+        * Created directories are automatically destroyed during tearDown()
         *
         * @return string
         */
        protected function createRealTestdir() {
                $basedir = PATH_site . 'typo3temp/' . uniqid('fal-test-');
                mkdir($basedir);
-               self::$testDirs[] = $basedir;
+               $this->testDirs[] = $basedir;
                return $basedir;
        }
 
index a059d57..b924316 100644 (file)
@@ -43,6 +43,7 @@ class FileReferenceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        public function tearDown() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
+               parent::tearDown();
        }
 
        /**
index eab539a..2d06152 100644 (file)
@@ -55,6 +55,7 @@ class FileTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        public function tearDown() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
+               parent::tearDown();
        }
 
        /**
index 085d9e3..ba1152d 100644 (file)
@@ -41,7 +41,7 @@ class FolderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        protected $singletonInstances = array();
 
-       private $basedir = 'basedir';
+       protected $basedir = 'basedir';
 
        public function setUp() {
                $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
@@ -50,6 +50,7 @@ class FolderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        protected function tearDown() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
+               parent::tearDown();
        }
 
        protected function createFolderFixture($path, $name, $mockedStorage = NULL) {
index 0bac403..fbc6c43 100644 (file)
@@ -37,9 +37,9 @@ class AbstractRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Core\Resource\AbstractRepository
         */
-       private $fixture;
+       protected $fixture;
 
-       private $mockedDb;
+       protected $mockedDb;
 
        protected function createDatabaseMock() {
                $this->mockedDb = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection');
index fae89ec..bdaa41f 100644 (file)
@@ -39,17 +39,12 @@ class FactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Core\Resource\ResourceFactory
         */
-       private $fixture;
-
-       /**
-        * @var boolean
-        */
-       private $objectCreated = FALSE;
+       protected $fixture;
 
        /**
         * @var array
         */
-       private $filesCreated = array();
+       protected $filesCreated = array();
 
        public function setUp() {
                $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
@@ -61,6 +56,7 @@ class FactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                foreach ($this->filesCreated as $file) {
                        unlink($file);
                }
+               parent::tearDown();
        }
 
        /**********************************
index ab92afd..f5f0912 100644 (file)
@@ -41,7 +41,7 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
        /**
         * @var \TYPO3\CMS\Core\Resource\ResourceStorage
         */
-       private $fixture;
+       protected $fixture;
 
        public function setUp() {
                parent::setUp();
@@ -55,8 +55,8 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
        }
 
        public function tearDown() {
-               parent::tearDown();
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
+               parent::tearDown();
        }
 
        /**
index 62bf8cd..f585e3c 100644 (file)
@@ -58,7 +58,7 @@ class FrontendContentAdapterServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCa
        public function tearDown() {
                call_user_func_array($this->accessibleFixtureName . '::_setStatic', array('migrationCache', array()));
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
-               unset($this->fileRepositoryMock);
+               parent::tearDown();
        }
 
        /**
index c321203..abe1e0a 100644 (file)
@@ -74,11 +74,8 @@ class FileExtensionFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * Cleans up this test suite.
         */
        protected function tearDown() {
-               unset($this->fileFactoryMock);
-               unset($this->tceMainMock);
-               unset($this->parameters);
-               unset($this->filter);
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
+               parent::tearDown();
        }
 
        /**
index bb66082..67feba9 100644 (file)
@@ -45,15 +45,6 @@ class TypoScriptParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tear down
-        *
-        * @return void
-        */
-       protected function tearDown() {
-               unset($this->typoScriptParser);
-       }
-
-       /**
         * Data provider for executeValueModifierReturnsModifiedResult
         *
         * @return array modifier name, modifier arguments, current value, expected result
index b144076..fd816c3 100644 (file)
@@ -60,16 +60,6 @@ class TemplateServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down this test case.
-        *
-        * @return void
-        */
-       protected function tearDown() {
-               unset($this->templateService);
-               unset($this->templateServiceMock);
-       }
-
-       /**
         * @test
         */
        public function versionOlCallsVersionOlOfPageSelectClassWithGivenRow() {
index 3ba55f9..c4602f4 100644 (file)
@@ -31,30 +31,6 @@ namespace TYPO3\CMS\Core\Tests\Unit\Utility;
  */
 class ClientUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
-       /**
-        * backed-up TYPO3_CONF_VARS SC_OPTIONS
-        *
-        * @var array
-        */
-       private $scOptionsBackup = array();
-
-       /**
-        * backed-up T3_VAR callUserFunction
-        *
-        * @var array
-        */
-       private $callUserFunctionBackup = array();
-
-       public function setUp() {
-               $this->scOptionsBackup = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'];
-               $this->callUserFunctionBackup = $GLOBALS['T3_VAR']['callUserFunction'];
-       }
-
-       public function tearDown() {
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'] = $this->scOptionsBackup;
-               $GLOBALS['T3_VAR']['callUserFunction'] = $this->callUserFunctionBackup;
-       }
-
        //////////////////////////////////////////////////////////
        // Utility Functions
        //////////////////////////////////////////////////////////
index b7c26df..db5bbce 100644 (file)
@@ -83,6 +83,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                ExtensionManagementUtilityAccessibleProxy::setPackageManager($this->backUpPackageManager);
                $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($this->backUpPackageManager);
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
+               parent::tearDown();
        }
 
        /**
index a195595..9a935e6 100644 (file)
@@ -55,6 +55,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                foreach ($this->testFilesToDelete as $absoluteFileName) {
                        Utility\GeneralUtility::rmdir($absoluteFileName, TRUE);
                }
+               parent::tearDown();
        }
 
        /**
index 84e7eb9..5031f1a 100644 (file)
@@ -36,30 +36,13 @@ class MailUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        protected $singletonInstances = array();
 
-       /**
-        * backed-up TYPO3_CONF_VARS SC_OPTIONS
-        *
-        * @var array
-        */
-       private $scOptionsBackup = array();
-
-       /**
-        * backed-up T3_VAR callUserFunction
-        *
-        * @var array
-        */
-       private $callUserFunctionBackup = array();
-
        public function setUp() {
                $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
-               $this->scOptionsBackup = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'];
-               $this->callUserFunctionBackup = $GLOBALS['T3_VAR']['callUserFunction'];
        }
 
        public function tearDown() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'] = $this->scOptionsBackup;
-               $GLOBALS['T3_VAR']['callUserFunction'] = $this->callUserFunctionBackup;
+               parent::tearDown();
        }
 
        //////////////////////////
index 26514fc..b269abd 100644 (file)
@@ -42,4 +42,31 @@ abstract class UnitTestCase extends BaseTestCase {
         */
        protected $backupGlobalsBlacklist = array('TYPO3_LOADED_EXT');
 
+       /**
+        * Unset all additional properties of test classes to help PHP
+        * garbage collection. This reduces memory footprint with lots
+        * of tests.
+        *
+        * If owerwriting tearDown() in test classes, please call
+        * parent::tearDown() at the end. Unsetting of own properties
+        * is not needed this way.
+        *
+        * @return void
+        */
+       protected function tearDown() {
+               $reflection = new \ReflectionObject($this);
+               foreach ($reflection->getProperties() as $property) {
+                       $declaringClass = $property->getDeclaringClass()->getName();
+                       if (
+                               !$property->isStatic()
+                               && $declaringClass !== 'TYPO3\CMS\Core\Tests\UnitTestCase'
+                               && $declaringClass !== 'TYPO3\CMS\Core\Tests\BaseTestCase'
+                               && strpos($property->getDeclaringClass()->getName(), 'PHPUnit_') !== 0
+                       ) {
+                               $propertyName = $property->getName();
+                               unset($this->$propertyName);
+                       }
+               }
+               unset($reflection);
+       }
 }
index 8e7c1d7..8d658bc 100644 (file)
@@ -30,6 +30,7 @@ class DatabaseConnectionMssqlTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function tearDown() {
                // Clear DBAL-generated cache files
                $GLOBALS['TYPO3_DB']->clearCachedFieldInfo();
+               parent::tearDown();
        }
 
        /**
index c039b3a..de682b2 100644 (file)
@@ -30,6 +30,7 @@ class DatabaseConnectionOracleTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function tearDown() {
                // Clear DBAL-generated cache files
                $GLOBALS['TYPO3_DB']->clearCachedFieldInfo();
+               parent::tearDown();
        }
 
        /**
index afa8c49..bdc7a65 100644 (file)
@@ -30,6 +30,7 @@ class DatabaseConnectionPostgresqlTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
        public function tearDown() {
                // Clear DBAL-generated cache files
                $GLOBALS['TYPO3_DB']->clearCachedFieldInfo();
+               parent::tearDown();
        }
 
        /**
index bcfb8fe..1d9d816 100644 (file)
@@ -33,6 +33,7 @@ class DatabaseConnectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                foreach ($this->temporaryFiles as $filename) {
                        unlink($filename);
                }
+               parent::tearDown();
        }
 
        /**
index 3714b2c..b0d15da 100644 (file)
@@ -45,13 +45,6 @@ class SqlParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Cleans up the environment after running a test.
-        */
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
-       /**
         * Cleans a SQL query.
         *
         * @param mixed $sql
index b01cee6..1f71102 100644 (file)
@@ -38,10 +38,6 @@ class DocumentFormatTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture = new \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index b9a1ae4..a16b5ae 100644 (file)
@@ -38,10 +38,6 @@ class DocumentTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture = new \TYPO3\CMS\Documentation\Domain\Model\Document();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index 0b71e37..80944a9 100644 (file)
@@ -38,10 +38,6 @@ class DocumentTranslationTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $this->fixture = new \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index 854ada4..4f0b138 100644 (file)
@@ -49,6 +49,7 @@ class BootstrapTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function tearDown() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::purgeInstances();
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
+               parent::tearDown();
        }
 
        /**
index d2e3459..32f8874 100644 (file)
@@ -42,10 +42,6 @@ class BackendUserGroupTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture = new \TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index 87a2db3..f42b720 100644 (file)
@@ -43,10 +43,6 @@ class BackendUserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture = new \TYPO3\CMS\Extbase\Domain\Model\BackendUser();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index e047faf..7b39ad5 100644 (file)
@@ -33,16 +33,12 @@ class CategoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        /**
         * @var \TYPO3\CMS\Extbase\Domain\Model\Category
         */
-       private $fixture = NULL;
+       protected $fixture = NULL;
 
        public function setUp() {
                $this->fixture = new \TYPO3\CMS\Extbase\Domain\Model\Category();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index 510cdea..9b7de7c 100755 (executable)
@@ -42,10 +42,6 @@ class FileMountTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture = new \TYPO3\CMS\Extbase\Domain\Model\FileMount();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index e18edf3..9656035 100644 (file)
@@ -42,10 +42,6 @@ class FrontendUserGroupTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture = new \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index c5fc253..404d90c 100644 (file)
@@ -42,10 +42,6 @@ class FrontendUserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture = new \TYPO3\CMS\Extbase\Domain\Model\FrontendUser();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index cd83065..3266ad7 100644 (file)
@@ -33,16 +33,12 @@ class CategoryRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
        /**
         * @var \TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository
         */
-       private $fixture = NULL;
+       protected $fixture = NULL;
 
        protected function setUp() {
                $this->fixture = new \TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository($this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'));
        }
 
-       protected function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index e19457e..ad0a28a 100644 (file)
@@ -33,16 +33,12 @@ class FileMountRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
        /**
         * @var \TYPO3\CMS\Extbase\Domain\Repository\FileMountRepository
         */
-       private $fixture = NULL;
+       protected $fixture = NULL;
 
        protected function setUp() {
                $this->fixture = new \TYPO3\CMS\Extbase\Domain\Repository\FileMountRepository($this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface'));
        }
 
-       protected function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index 31a25ac..955ed32 100644 (file)
@@ -26,11 +26,6 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Mvc\Cli;
 class CommandManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
        /**
-        * @var array
-        */
-       protected $commandControllerBackup = array();
-
-       /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
         */
        protected $mockObjectManager;
@@ -41,16 +36,11 @@ class CommandManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        protected $commandManager;
 
        public function setUp() {
-               $this->commandControllerBackup = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'];
                $this->commandManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager', array('getAvailableCommands'));
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
                $this->commandManager->_set('objectManager', $this->mockObjectManager);
        }
 
-       public function tearDown() {
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'] = $this->commandControllerBackup;
-       }
-
        /**
         * @test
         * @author Bastian Waidelich <bastian@typo3.org>
index e4c8aa9..66b2f22 100644 (file)
@@ -33,21 +33,6 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\Routing;
 class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
 
        /**
-        * @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
-        */
-       protected $tsfeBackup;
-
-       /**
-        * @var array
-        */
-       protected $getBackup;
-
-       /**
-        * @var array
-        */
-       protected $postBackup;
-
-       /**
         * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
         */
        protected $mockConfigurationManager;
@@ -73,10 +58,7 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        protected $uriBuilder;
 
        public function setUp() {
-               $this->tsfeBackup = $GLOBALS['TSFE'];
                $GLOBALS['TSFE'] = $this->getMock('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array(), array(), '', FALSE);
-               $this->getBackup = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET();
-               $this->postBackup = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST();
                $this->mockContentObject = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
                $this->mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
                $this->mockExtensionService = $this->getMock('TYPO3\\CMS\\Extbase\\Service\\ExtensionService');
@@ -89,12 +71,6 @@ class UriBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->uriBuilder->_set('environmentService', $this->objectManager->get('TYPO3\\CMS\\Extbase\\Service\\EnvironmentService'));
        }
 
-       public function tearDown() {
-               $GLOBALS['TSFE'] = $this->tsfeBackup;
-               \TYPO3\CMS\Core\Utility\GeneralUtility::_GETset($this->getBackup);
-               $_POST = $this->postBackup;
-       }
-
        /**
         * @test
         */
index a84b91e..9cd1caa 100644 (file)
@@ -36,10 +36,10 @@ class ClassInfoFactoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        /**
         * @var \TYPO3\CMS\Extbase\Object\Container\ClassInfoFactory
         */
-       private $classInfoFactory;
+       protected $classInfoFactory;
 
        /**
-
+        * Set up
         */
        public function setUp() {
                $this->classInfoFactory = new \TYPO3\CMS\Extbase\Object\Container\ClassInfoFactory();
index 6599894..b1b0463 100644 (file)
@@ -38,12 +38,12 @@ class ContainerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        /**
         * @var \TYPO3\CMS\Extbase\Object\Container\Container
         */
-       private $container;
+       protected $container;
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\Container\ClassInfo
         */
-       private $cachedClassInfo;
+       protected $cachedClassInfo;
 
        public function setUp() {
                //our mocked cache will allways indicate that he has nothing in the cache to force that we get the real classinfo
index 243f473..0d5a869 100644 (file)
@@ -73,10 +73,6 @@ class QueryFactoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->queryFactory->_set('dataMapper', $this->dataMapper);
        }
 
-       protected function tearDown() {
-               unset($this->objectManager, $this->dataMapper, $this->queryFactory);
-       }
-
        public function getStaticAndRootLevelAndExpectedResult() {
                return array(
                        'Respect storage page is set when entity is neither marked as static nor as rootLevel.' => array(FALSE, FALSE, TRUE),
index bde810f..f702f83 100644 (file)
@@ -67,10 +67,6 @@ class MapperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture->_set('validatorResolver', $validatorResolver);
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index a559b42..979ad26 100644 (file)
@@ -155,10 +155,6 @@ class LocalizationUtilityTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                $this->localization = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility', array('getConfigurationManager'));
        }
 
-       public function tearDown() {
-               $this->localization = NULL;
-       }
-
        /**
         * @test
         * @author Sebastian Kurf├╝rst <sebastian@typo3.org>
index 19c1cd2..cfed159 100644 (file)
@@ -57,6 +57,7 @@ class UpdateExtensionListTaskTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTest
         */
        public function tearDown() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
+               parent::tearDown();
        }
 
        /**
index a6159c7..e684351 100644 (file)
@@ -54,6 +54,7 @@ class FileHandlingUtilityTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                                rmdir($resource);
                        }
                }
+               parent::tearDown();
        }
 
        /**
index dbd7811..3d91d1e 100644 (file)
@@ -97,6 +97,7 @@ class InstallUtilityTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                foreach ($this->fakedExtensions as $extension => $dummy) {
                        \TYPO3\CMS\Core\Utility\GeneralUtility::rmdir(PATH_site . 'typo3temp/' . $extension, TRUE);
                }
+               parent::tearDown();
        }
 
        /**
index c50f868..6b119c9 100644 (file)
@@ -34,7 +34,7 @@ class ListUtilityTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
         */
-       private $subject;
+       protected $subject;
 
        /**
         * @return void
@@ -56,13 +56,6 @@ class ListUtilityTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        }
 
        /**
-        * @return void
-        */
-       public function tearDown() {
-               unset($this->subject);
-       }
-
-       /**
         * @return array
         */
        public function getAvailableAndInstalledExtensionsDataProvider() {
index e0dfcd8..fb2201a 100644 (file)
@@ -52,7 +52,7 @@ class FrontendLoginTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var string
         */
-       private $testTableName;
+       protected $testTableName;
 
        /**
         * Set up
@@ -68,13 +68,6 @@ class FrontendLoginTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tear down
-        */
-       public function tearDown() {
-               $this->accessibleFixture = NULL;
-       }
-
-       /**
         * Set up a fake site path and host
         */
        protected function setUpFakeSitePathAndHost() {
index bc6ec8f..ab5b607 100644 (file)
@@ -28,10 +28,6 @@ class ParsingStateTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->parsingState = new \TYPO3\CMS\Fluid\Core\Parser\ParsingState();
        }
 
-       public function tearDown() {
-               unset($this->parsingState);
-       }
-
        /**
         * @test
         */
index e72b9f1..ac61e9b 100644 (file)
@@ -25,10 +25,6 @@ class TemplateVariableContainerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTe
                $this->variableContainer = new \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer();
        }
 
-       public function tearDown() {
-               unset($this->variableContainer);
-       }
-
        /**
         * @test
         */
index e860cce..1058a34 100644 (file)
@@ -50,25 +50,7 @@ class WidgetRequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCas
         */
        protected $mockWidgetContext;
 
-       /**
-        * @var array
-        */
-       protected $serverBackup;
-
-       /**
-        * @var array
-        */
-       protected $getBackup;
-
-       /**
-        * @var array
-        */
-       protected $postBackup;
-
        public function setUp() {
-               $this->serverBackup = $_SERVER;
-               $this->getBackup = $_GET;
-               $this->postBackup = $_POST;
                $this->widgetRequestBuilder = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequestBuilder', array('setArgumentsFromRawRequestData'));
                $this->mockWidgetRequest = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
                $this->mockObjectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
@@ -81,15 +63,6 @@ class WidgetRequestBuilderTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCas
        }
 
        /**
-        * @return void
-        */
-       public function tearDown() {
-               $_SERVER = $this->serverBackup;
-               $_GET = $this->getBackup;
-               $_POST = $this->postBackup;
-       }
-
-       /**
         * @test
         */
        public function buildSetsRequestUri() {
index 21dfde2..f924931 100644 (file)
@@ -31,22 +31,12 @@ class WidgetRequestHandlerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCas
        protected $widgetRequestHandler;
 
        /**
-        * @var array
-        */
-       protected $getBackup;
-
-       /**
-
+        * Set up
         */
        public function setUp() {
-               $this->getBackup = $_GET;
                $this->widgetRequestHandler = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequestHandler', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               $_GET = $this->getBackup;
-       }
-
        /**
         * @test
         */
index 3d97c57..b6009ad 100644 (file)
@@ -134,6 +134,7 @@ class StandaloneViewTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        public function tearDown() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::purgeInstances();
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
+               parent::tearDown();
        }
 
        /**
index a6764c8..7ace577 100644 (file)
@@ -31,14 +31,8 @@ class IfAuthenticatedViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelp
         */
        protected $viewHelper;
 
-       /**
-        * @var \TYPO3\CMS\Backend\FrontendBackendUserAuthentication
-        */
-       protected $beUserBackup;
-
        public function setUp() {
                parent::setUp();
-               $this->beUserBackup = isset($GLOBALS['BE_USER']) ? $GLOBALS['BE_USER'] : NULL;
                $GLOBALS['BE_USER'] = new \stdClass();
                $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\Security\\IfAuthenticatedViewHelper', array('renderThenChild', 'renderElseChild'));
                $this->viewHelper->expects($this->any())->method('renderThenChild')->will($this->returnValue('then child'));
@@ -47,10 +41,6 @@ class IfAuthenticatedViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelp
                $this->viewHelper->initializeArguments();
        }
 
-       public function tearDown() {
-               $GLOBALS['BE_USER'] = $this->beUserBackup;
-       }
-
        /**
         * @test
         */
index 3bde42a..1f8c8a7 100644 (file)
@@ -31,14 +31,8 @@ class IfHasRoleViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Vi
         */
        protected $viewHelper;
 
-       /**
-        * @var \TYPO3\CMS\Backend\FrontendBackendUserAuthentication
-        */
-       protected $beUserBackup;
-
        public function setUp() {
                parent::setUp();
-               $this->beUserBackup = isset($GLOBALS['BE_USER']) ? $GLOBALS['BE_USER'] : NULL;
                $GLOBALS['BE_USER'] = new \stdClass();
                $GLOBALS['BE_USER']->userGroups = array(
                        array(
@@ -57,10 +51,6 @@ class IfHasRoleViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Vi
                $this->viewHelper->initializeArguments();
        }
 
-       public function tearDown() {
-               $GLOBALS['BE_USER'] = $this->beUserBackup;
-       }
-
        /**
         * @test
         */
index 705e100..75a2582 100644 (file)
@@ -44,6 +44,7 @@ class SelectViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
                foreach ($this->backupLocales as $category => $locale) {
                        setlocale(constant($category), $locale);
                }
+               parent::tearDown();
        }
 
        /**
index f721f1f..37f56d7 100644 (file)
@@ -41,6 +41,7 @@ class DateViewHelperTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                        setlocale(constant($category), $locale);
                }
                date_default_timezone_set($this->timezone);
+               parent::tearDown();
        }
 
        /**
index 511d493..9e13ce6 100644 (file)
@@ -31,14 +31,8 @@ class IfAuthenticatedViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelp
         */
        protected $viewHelper;
 
-       /**
-        * @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
-        */
-       protected $tsfeBackup;
-
        public function setUp() {
                parent::setUp();
-               $this->tsfeBackup = isset($GLOBALS['TSFE']) ? $GLOBALS['TSFE'] : NULL;
                $GLOBALS['TSFE'] = new \stdClass();
                $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\Security\\IfAuthenticatedViewHelper', array('renderThenChild', 'renderElseChild'));
                $this->viewHelper->expects($this->any())->method('renderThenChild')->will($this->returnValue('then child'));
@@ -47,10 +41,6 @@ class IfAuthenticatedViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelp
                $this->viewHelper->initializeArguments();
        }
 
-       public function tearDown() {
-               $GLOBALS['TSFE'] = $this->tsfeBackup;
-       }
-
        /**
         * @test
         */
index 67b30e7..94cef63 100644 (file)
@@ -31,15 +31,6 @@ class PaginateControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
        }
 
        /**
-        * Cleans up this test case
-        *
-        * @return void
-        */
-       public function tearDown() {
-               unset($this->controller);
-       }
-
-       /**
         * @test
         */
        public function calculateDisplayRangeDeterminesCorrectDisplayRangeStartAndEndForEvenMaximumNumberOfLinks() {
index ac25cd4..1abdcbb 100644 (file)
@@ -41,10 +41,6 @@ class TypoScriptFactoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->fixture = new \TYPO3\CMS\Form\Domain\Factory\TypoScriptFactory();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index eb371f1..2b05ab3 100644 (file)
@@ -45,13 +45,6 @@ class AlphabeticFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tear down
-        */
-       public function tearDown() {
-               $this->fixture = NULL;
-       }
-
-       /**
         * @test
         */
        public function filterForStringWithUnicodeCharactersAndSpacesReturnsInputString() {
index 6c74ca0..8fcc960 100644 (file)
@@ -45,13 +45,6 @@ class AlphanumericFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tear down
-        */
-       public function tearDown() {
-               $this->fixture = NULL;
-       }
-
-       /**
         * @test
         */
        public function filterForStringWithUnicodeCharactersAndSpacesReturnsInputString() {
index 5fb7b8c..aa0c86e 100644 (file)
@@ -41,10 +41,6 @@ class CurrencyFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = new \TYPO3\CMS\Form\Filter\CurrencyFilter();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        public function validDataProvider() {
                return array(
                        '1200 => 1.200,00' => array(
index 9361fd4..16361bb 100644 (file)
@@ -41,10 +41,6 @@ class DigitFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = new \TYPO3\CMS\Form\Filter\DigitFilter();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        public function validDataProvider() {
                return array(
                        '1,00 -> 100' => array('1,00', '100'),
index 14e5270..f21abff 100644 (file)
@@ -41,10 +41,6 @@ class IntegerFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = new \TYPO3\CMS\Form\Filter\IntegerFilter();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        public function dataProvider() {
                return array(
                        '"1" -> 1' => array('1', 1),
index 6dafe1f..28f6b96 100644 (file)
@@ -44,11 +44,6 @@ class LowerCaseFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $GLOBALS['TSFE']->renderCharset = 'utf-8';
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-               unset($GLOBALS['TSFE']);
-       }
-
        public function dataProvider() {
                return array(
                        'a -> a' => array('a', 'a'),
index 2d71b89..762c6db 100644 (file)
@@ -41,10 +41,6 @@ class RegExpFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = new \TYPO3\CMS\Form\Filter\RegExpFilter();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        public function dataProvider() {
                return array(
                        'a-a -> aa for /-/' => array(
index e501786..2cb04da 100644 (file)
@@ -41,10 +41,6 @@ class RemoveXssFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = new \TYPO3\CMS\Form\Filter\RemoveXssFilter();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        public function maliciousStringProvider() {
                return array(
                        '<IMG SRC="javascript:alert(\'XSS\');">' => array('<IMG SRC="javascript:alert(\'XSS\');">'),
index 38c43bd..b5e0743 100644 (file)
@@ -44,13 +44,6 @@ class StripNewLinesFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = new \TYPO3\CMS\Form\Filter\StripNewLinesFilter();
        }
 
-       /**
-        * Tear down
-        */
-       public function tearDown() {
-               $this->fixture = NULL;
-       }
-
        public function dataProviderWithNewlines() {
                return array(
                        'some\ntext' => array("some\ntext", 'some text'),
index 7389e11..e713b79 100644 (file)
@@ -44,13 +44,6 @@ class TitleCaseFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = new \TYPO3\CMS\Form\Filter\TitleCaseFilter();
        }
 
-       /**
-        * Tear down
-        */
-       public function tearDown() {
-               $this->fixture = NULL;
-       }
-
        public function stringProvider() {
                return array(
                        'some text' => array('some text', 'Some Text'),
index 3db277c..52448ef 100644 (file)
@@ -44,13 +44,6 @@ class TrimFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fixture = new \TYPO3\CMS\Form\Filter\TrimFilter();
        }
 
-       /**
-        * Tear down
-        */
-       public function tearDown() {
-               $this->fixture = NULL;
-       }
-
        public function stringProvider() {
                return array(
                        '\tsome text ' => array("\tsome text ", 'some text'),
index 2c0ca3b..464f6ea 100644 (file)
@@ -47,14 +47,6 @@ class UpperCaseFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $GLOBALS['TSFE']->renderCharset = 'utf-8';
        }
 
-       /**
-        * Tear down
-        */
-       public function tearDown() {
-               $this->fixture = NULL;
-               unset($GLOBALS['TSFE']);
-       }
-
        public function stringProvider() {
                return array(
                        'asdf' => array('asdf', 'ASDF'),
index e4d2800..8f67d9d 100644 (file)
@@ -51,15 +51,6 @@ class MailPostProcessorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        }
 
        /**
-        * Tear down
-        *
-        * @return void
-        */
-       protected function tearDown() {
-               unset($this->mailPostProcessor);
-       }
-
-       /**
         * Data provider for filterValidEmailsReturnsOnlyValidAddresses
         *
         * @return array input string, expected return array
index da47557..afb252d 100644 (file)
@@ -48,13 +48,6 @@ class AlphabeticValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
        }
 
        /**
-        * Tear down
-        */
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
-       /**
         * @return array
         */
        public function validDataProviderWithoutWhitespace() {
index 9970a40..99d108e 100644 (file)
@@ -43,10 +43,6 @@ class AlphanumericValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCa
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\AlphanumericValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validDataProviderWithoutWhitespace() {
                return array(
                        'ascii without spaces' => array('thisismyinput4711'),
index 702a482..f5287bf 100644 (file)
@@ -44,10 +44,6 @@ class BetweenValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\BetweenValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validNonInclusiveDataProvider() {
                return array(
                        '3 < 5 < 7'      => array(array(3, 5, 7)),
index 9e42c31..10dc91f 100644 (file)
@@ -44,10 +44,6 @@ class DateValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\DateValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validDateProvider() {
                return array(
                        '28-03-2012' => array(array('%e-%m-%Y', '28-03-2012')),
index d91b394..f6258c3 100644 (file)
@@ -43,10 +43,6 @@ class DigitValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\DigitValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validDigitProvider() {
                return array(
                        'stringified integer'                    => array('2012'),
index 1938797..04b0307 100644 (file)
@@ -44,10 +44,6 @@ class EmailValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\EmailValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validEmailProvider() {
                return array(
                        'a@b.de' => array('a@b.de'),
index ae88622..955a19b 100644 (file)
@@ -44,10 +44,6 @@ class EqualsValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\EqualsValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function invalidPairProvider() {
                return array(
                        'somethingElse !== something' => array(array('somethingElse', 'something')),
index a27b328..b641bae 100644 (file)
@@ -43,10 +43,6 @@ class FileAllowedTypesValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTe
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\FileAllowedTypesValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validTypesProvider() {
                return array(
                        'pdf in (pdf)'       => array(array('application/pdf', 'application/pdf')),
index f895712..f590fcb 100644 (file)
@@ -43,10 +43,6 @@ class FileMaximumSizeValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\FileMaximumSizeValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validSizesProvider() {
                return array(
                        '11B for max. 12B' => array(array(12, 11)),
index e12f4a9..0b00f1c 100644 (file)
@@ -45,10 +45,6 @@ class FileMinimumSizeValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTes
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\FileMinimumSizeValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validSizesProvider() {
                return array(
                        '12B for min. 11B' => array(array(11, 12)),
index ca3eac0..79072f4 100644 (file)
@@ -43,10 +43,6 @@ class FloatValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\FloatValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validFloatProvider() {
                return array(
                        '12.1 for en_US locale' => array(array(12.1, 'en_US')),
index 4bb6200..b29f25e 100644 (file)
@@ -45,10 +45,6 @@ class GreaterThanValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCas
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\GreaterThanValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validNumberProvider() {
                return array(
                        '13 > 12' => array(array(12, 13)),
index dc2254d..e27c0ef 100644 (file)
@@ -44,10 +44,6 @@ class InArrayValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\InArrayValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validArrayProvider() {
                return array(
                        '12 in (12, 13)' => array(array(array(12, 13), 12))
index 67c3d4b..f73a9fe 100644 (file)
@@ -43,10 +43,6 @@ class IntegerValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\IntegerValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validIntegerProvider() {
                return array(
                        '12 for de locale'    => array(array(12, 'de')),
index c5f9cc0..92ae815 100644 (file)
@@ -44,11 +44,6 @@ class IpValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\IpValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper);
-               unset($this->subject);
-       }
-
        public function validIpv4Provider() {
                return array(
                        '127.0.0.1'   => array('127.0.0.1'),
index d2a16db..f13c7a2 100644 (file)
@@ -54,13 +54,6 @@ class LengthValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        }
 
        /**
-        * Tear down
-        */
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
-       /**
         * @return array
         */
        public function validLengthProvider() {
index 0e48f54..38dc8fa 100644 (file)
@@ -44,10 +44,6 @@ class LessThanValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\LessthanValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validValueProvider() {
                return array(
                        '4 < 8' => array(array(8, 4)),
index d3dab1e..ba16ac1 100644 (file)
@@ -44,10 +44,6 @@ class RegExpValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\RegExpValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validDataProvider() {
                return array(
                        '/^a/ matches a' => array(array('/^a/', 'a')),
index 103f234..fda4dbc 100644 (file)
@@ -44,10 +44,6 @@ class RequiredValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\RequiredValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validDataProvider() {
                return array(
                        'a'   => array('a'),
index 735fb96..5eb16aa 100644 (file)
@@ -44,10 +44,6 @@ class UriValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $this->subject = $this->getMock('TYPO3\\CMS\\Form\\Validation\\UriValidator', array('dummy'), array(), '', FALSE);
        }
 
-       public function tearDown() {
-               unset($this->helper, $this->subject);
-       }
-
        public function validDataProvider() {
                return array(
                        'http://example.net'              => array('http://example.net'),
index 9554abf..dc1e75b 100644 (file)
@@ -54,11 +54,6 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->matchCondition = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Configuration\\TypoScript\\ConditionMatching\\ConditionMatcher');
        }
 
-       public function tearDown() {
-               unset($this->matchCondition);
-               unset($GLOBALS[$this->testGlobalNamespace]);
-       }
-
        /**
         * Tests whether a faulty expression fails.
         *
index bc04e85..73fde23 100644 (file)
@@ -60,13 +60,6 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tear down
-        */
-       public function tearDown() {
-               unset($this->subject, $this->tsfe);
-       }
-
-       /**
         * @return array
         */
        public function renderReturnsFilesForFileReferencesDataProvider() {
index 90518f7..28e7606 100644 (file)
@@ -79,6 +79,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function tearDown() {
                \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
+               parent::tearDown();
        }
 
        /**
index bd77fab..dfaa137 100644 (file)
@@ -33,7 +33,7 @@ class TypoScriptFrontendControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
        /**
         * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
         */
-       private $fixture;
+       protected $fixture;
 
        public function setUp() {
                $this->fixture = $this->getAccessibleMock('\\TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array('dummy'), array(), '', FALSE);
@@ -41,10 +41,6 @@ class TypoScriptFrontendControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
                $this->fixture->TYPO3_CONF_VARS['SYS']['encryptionKey'] = '170928423746123078941623042360abceb12341234231';
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        ////////////////////////////////
        // Tests concerning rendering content
        ////////////////////////////////
index 7d2c06d..9848fda 100644 (file)
@@ -29,10 +29,11 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\MediaWizard;
  * @author Sebastian Fischer <typo3@marketing-factory.de>
  */
 class MediaWizardProviderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+
        /**
         * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\TYPO3\CMS\Frontend\MediaWizard\MediaWizardProvider
         */
-       private $fixture;
+       protected $fixture;
 
        /**
         * Setup
@@ -42,13 +43,6 @@ class MediaWizardProviderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tear down
-        */
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
-       /**
         * @return array
         */
        public function process_youtubeDataProvider() {
index d83f616..64c1bec 100644 (file)
@@ -56,10 +56,6 @@ class CacheHashCalculatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                ));
        }
 
-       public function tearDown() {
-               $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = $this->confCache['encryptionKey'];
-       }
-
        /**
         * @dataProvider cacheHashCalculationDataprovider
         * @test
index 8492597..4e5c695 100644 (file)
@@ -46,13 +46,6 @@ class PageRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down this testcase
-        */
-       public function tearDown() {
-               unset($this->pageSelectObject);
-       }
-
-       /**
         * Tests whether the getPage Hook is called correctly.
         *
         * @test
index 451ff80..ba8e895 100644 (file)
@@ -56,15 +56,6 @@ class AbstractPluginTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down this testcase
-        */
-       public function tearDown() {
-               parent::tearDown();
-
-               $this->abstractPlugin = NULL;
-       }
-
-       /**
         * Data provider for piSetPiVarDefaultsStdWrap
         *
         * @return array input-array with configuration and stdWrap, expected output-array in piVars
index 1c89f7d..7c0b3d2 100644 (file)
@@ -57,10 +57,10 @@ class IndexerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * Explicitly clean up the indexer object to prevent any memory leaks
         */
        public function tearDown() {
-               $this->fixture = NULL;
                if ($this->temporaryFileName) {
                        @unlink($this->temporaryFileName);
                }
+               parent::tearDown();
        }
 
        /**
index 8321e20..73ae8bf 100644 (file)
@@ -43,6 +43,7 @@ class ExtensionCompatibilityTesterTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
                if (file_exists(PATH_site . 'typo3temp/ExtensionCompatibilityTester.txt')) {
                        unlink(PATH_site . 'typo3temp/ExtensionCompatibilityTester.txt');
                }
+               parent::tearDown();
        }
 
        /**
index 4aaff87..7d52417 100644 (file)
@@ -46,6 +46,7 @@ class AbstractNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                \TYPO3\CMS\Core\Utility\GeneralUtility::rmdir($node, TRUE);
                        }
                }
+               parent::tearDown();
        }
 
        /**
index 5f94aa5..63d18c9 100644 (file)
@@ -43,6 +43,7 @@ class DirectoryNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                \TYPO3\CMS\Core\Utility\GeneralUtility::rmdir($node, TRUE);
                        }
                }
+               parent::tearDown();
        }
 
        /**
index df35977..7d0ccac 100644 (file)
@@ -43,6 +43,7 @@ class FileNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                \TYPO3\CMS\Core\Utility\GeneralUtility::rmdir($node, TRUE);
                        }
                }
+               parent::tearDown();
        }
 
        /**
index adf6f61..3fdf161 100644 (file)
@@ -43,6 +43,7 @@ class LinkNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                \TYPO3\CMS\Core\Utility\GeneralUtility::rmdir($node, TRUE);
                        }
                }
+               parent::tearDown();
        }
 
        /**
index 1304509..bcf6297 100644 (file)
@@ -43,6 +43,7 @@ class RootNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                \TYPO3\CMS\Core\Utility\GeneralUtility::rmdir($node, TRUE);
                        }
                }
+               parent::tearDown();
        }
 
        /**
index a4ad0d1..4ae912a 100644 (file)
@@ -49,13 +49,6 @@ class SqlSchemaMigrationServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down the fixture
-        */
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
-       /**
         * @test
         */
        public function getDatabaseExtraFindsChangedFields() {
index 83f924e..e9c181c 100644 (file)
@@ -47,13 +47,6 @@ class ExtensionTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        }
 
        /**
-        * Tear down
-        */
-       public function tearDown() {
-               $this->fixture = NULL;
-       }
-
-       /**
         * @test
         */
        public function getKeyInitiallyReturnsEmptyString() {
index 522d82a..0b5857d 100644 (file)
@@ -46,13 +46,6 @@ class LanguageSelectionFormTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCa
        }
 
        /**
-        * Tear down
-        */
-       public function tearDown() {
-               $this->fixture = NULL;
-       }
-
-       /**
         * @test
         */
        public function getLanguagesInitiallyReturnsEmptyArray() {
index 5212b7d..98fee7a 100644 (file)
@@ -47,13 +47,6 @@ class LanguageTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        }
 
        /**
-        * Tear down
-        */
-       public function tearDown() {
-               $this->fixture = NULL;
-       }
-
-       /**
         * @test
         */
        public function getLocaleInitiallyReturnsEmptyString() {
index 6ed6525..2ee196d 100644 (file)
@@ -43,10 +43,6 @@ class UpdateTranslationFormTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCa
                $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\UpdateTranslationForm();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        /**
         * @test
         */
index 7c3fbc4..a94cf45 100644 (file)
@@ -34,16 +34,12 @@ class ArrayBrowserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @var \TYPO3\CMS\Lowlevel\Utility\ArrayBrowser
         */
-       private $fixture;
+       protected $fixture;
 
        public function setUp() {
                $this->fixture = new \TYPO3\CMS\Lowlevel\Utility\ArrayBrowser();
        }
 
-       public function tearDown() {
-               unset($this->fixture);
-       }
-
        ///////////////////////////////
        // Tests concerning depthKeys
        ///////////////////////////////
index c862930..db95cc3 100644 (file)
@@ -43,10 +43,6 @@ class CommandLineBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase  {
                $this->subject = new CommandLineBackend();
        }
 
-       public function tearDown() {
-               unset($this->subject);
-       }
-
        /**
         * @test
         */
index cf99d2b..bf1f10e 100644 (file)
@@ -43,10 +43,6 @@ class PhpBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase  {
                $this->subject = new PhpBackend();
        }
 
-       public function tearDown() {
-               unset($this->subject);
-       }
-
        /**
         * @test
         */
index efedf0c..889cfd0 100644 (file)
@@ -43,10 +43,6 @@ class KeypairTest extends \TYPO3\CMS\Core\Tests\UnitTestCase  {
                $this->subject = new Keypair();
        }
 
-       public function tearDown() {
-               unset($this->subject);
-       }
-
        /**
         * @test
         */
index 3d0a852..20a5fea 100644 (file)
@@ -51,15 +51,6 @@ class BlowfishSaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down objects and settings created in this testcase.
-        *
-        * @return void
-        */
-       public function tearDown() {
-               unset($this->objectInstance);
-       }
-
-       /**
         * Marks tests as skipped if the blowfish method is not available.
         *
         * @return void
index 06f8566..02c938a 100644 (file)
@@ -51,15 +51,6 @@ class Md5SaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down objects and settings created in this testcase.
-        *
-        * @return void
-        */
-       public function tearDown() {
-               $this->objectInstance = NULL;
-       }
-
-       /**
         * Prepares a message to be shown when a salted hashing is not supported.
         *
         * @return string Empty string if salted hashing method is available, otherwise an according warning
index 0508f0b..933e994 100644 (file)
@@ -51,15 +51,6 @@ class PhpassSaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down objects and settings created in this testcase.
-        *
-        * @return void
-        */
-       public function tearDown() {
-               $this->objectInstance = NULL;
-       }
-
-       /**
         * @test
         */
        public function hasCorrectBaseClass() {
index 39ddf43..d427ad9 100644 (file)
@@ -52,15 +52,6 @@ class SaltFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Tears down objects and settings created in this testcase.
-        *
-        * @return void
-        */
-       public function tearDown() {
-               $this->objectInstance = NULL;
-       }
-
-       /**
         * @test
         */
        public function objectInstanceNotNull() {
index 78ed750..7883d33 100644 (file)
@@ -46,15 +46,6 @@ class SchedulerModuleControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * Cleans up each test case.
-        *
-        * @return void
-        */
-       public function tearDown() {
-               $this->testObject = NULL;
-       }
-
-       /**
         * Data provider for checkDateWithStrtotimeValues
         *
         * @see checkDateWithStrtotimeValues
index bd50352..2e8048f 100644 (file)
@@ -53,6 +53,7 @@ class CronCommandTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        public function tearDown() {
                date_default_timezone_set($this->timezoneBackup);
+               parent::tearDown();
        }
 
        /**