[TASK] typo3/testing-framework now flushes runtime caches 08/58008/5
authorMichael Stucki <michael.stucki@typo3.org>
Thu, 23 Aug 2018 14:40:50 +0000 (16:40 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 1 Sep 2018 14:20:46 +0000 (16:20 +0200)
Unit test tearDown() now always calls
GeneralUtility::flushInternalRuntimeCaches() so most explicit
calls in unit tests can be removed.

composer require --dev typo3/testing-framework:~4.8.2

Resolves: #85948
Related: #85946
Releases: master, 8.7
Change-Id: I798047a06c3265404383540cacbd40d9719e7bfe
Reviewed-on: https://review.typo3.org/58008
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
17 files changed:
composer.json
composer.lock
typo3/sysext/backend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php
typo3/sysext/core/Tests/Unit/Authentication/AbstractUserAuthenticationTest.php
typo3/sysext/core/Tests/Unit/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcherTest.php
typo3/sysext/core/Tests/Unit/Http/ServerRequestFactoryTest.php
typo3/sysext/core/Tests/Unit/Resource/Rendering/YouTubeRendererTest.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/core/composer.json
typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php
typo3/sysext/extbase/Tests/Unit/Service/ImageScriptServiceTest.php
typo3/sysext/felogin/Tests/Unit/Controller/FrontendLoginControllerTest.php
typo3/sysext/frontend/Tests/Unit/Compatibility/LegacyDomainResolverTest.php
typo3/sysext/frontend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php
typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php
typo3/sysext/frontend/Tests/Unit/Typolink/AbstractTypolinkBuilderTest.php
typo3/sysext/frontend/Tests/UnitDeprecated/Controller/TypoScriptFrontendControllerTest.php

index f94bad0..01dd330 100644 (file)
@@ -69,7 +69,7 @@
                "fiunchinho/phpunit-randomizer": "^4.0",
                "friendsofphp/php-cs-fixer": "^2.12.2",
                "typo3/cms-styleguide": "~9.2.0",
-               "typo3/testing-framework": "~4.8.1"
+               "typo3/testing-framework": "~4.8.2"
        },
        "suggest": {
                "ext-gd": "GDlib/Freetype is required for building images with text (GIFBUILDER) and can also be used to scale images",
index edce038..1895933 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "229a286ebdeb595d90aff72a696054c1",
+    "content-hash": "4bce6d87628baf0180cac0d3db3fd4c1",
     "packages": [
         {
             "name": "cogpowered/finediff",
         },
         {
             "name": "typo3/testing-framework",
-            "version": "4.8.1",
+            "version": "4.8.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/TYPO3/testing-framework.git",
-                "reference": "66a73520e6b68b6bf96d5540b19c10abfde42732"
+                "reference": "487197e0a178cf28c1fe60f643a34f919260890d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/66a73520e6b68b6bf96d5540b19c10abfde42732",
-                "reference": "66a73520e6b68b6bf96d5540b19c10abfde42732",
+                "url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/487197e0a178cf28c1fe60f643a34f919260890d",
+                "reference": "487197e0a178cf28c1fe60f643a34f919260890d",
                 "shasum": ""
             },
             "require": {
                 "tests",
                 "typo3"
             ],
-            "time": "2018-08-30T19:45:19+00:00"
+            "time": "2018-09-01T13:52:19+00:00"
         },
         {
             "name": "webmozart/assert",
index 61069c1..cb17774 100644 (file)
@@ -60,7 +60,6 @@ class ConditionMatcherTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCas
         $this->testGlobalNamespace = $this->getUniqueId('TEST');
         $GLOBALS['TCA'][$this->testTableName] = ['ctrl' => []];
         $GLOBALS[$this->testGlobalNamespace] = [];
-        GeneralUtility::flushInternalRuntimeCaches();
         $this->setUpBackend();
         $this->matchCondition = $this->getAccessibleMock(ConditionMatcher::class, ['determineRootline'], [], '', false);
         $this->matchCondition->method('determineRootline')->willReturn([
index 097b481..de3c881 100644 (file)
@@ -74,7 +74,6 @@ class AbstractUserAuthenticationTest extends UnitTestCase
      */
     public function getHttpHeadersReturnsNormalNoCacheHeadersForNonIe()
     {
-        GeneralUtility::flushInternalRuntimeCaches();
         $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows NT 6.2; rv:22.0) Gecko/20130405 Firefox/23.0';
         $_SERVER['HTTPS'] = 'on';
         $subject = $this->getAccessibleMockForAbstractClass(AbstractUserAuthentication::class);
@@ -87,7 +86,6 @@ class AbstractUserAuthenticationTest extends UnitTestCase
      */
     public function getHttpHeadersReturnsSpecialNoCacheHeadersForIe()
     {
-        GeneralUtility::flushInternalRuntimeCaches();
         $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US)';
         $_SERVER['HTTPS'] = 'on';
         $subject = $this->getAccessibleMockForAbstractClass(AbstractUserAuthentication::class);
index cddf7e3..964f005 100644 (file)
@@ -59,7 +59,6 @@ class AbstractConditionMatcherTest extends UnitTestCase
 
         $this->resetSingletonInstances = true;
         $GLOBALS['TYPO3_REQUEST'] = new ServerRequest();
-        GeneralUtility::flushInternalRuntimeCaches();
 
         $typoScriptConditionProvider = GeneralUtility::makeInstance(TypoScriptConditionProvider::class);
 
index e7c6d83..75e6a3d 100644 (file)
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Core\Tests\Unit\Http;
 
 use TYPO3\CMS\Core\Http\ServerRequestFactory;
 use TYPO3\CMS\Core\Http\UploadedFile;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 /**
@@ -26,14 +25,6 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 class ServerRequestFactoryTest extends UnitTestCase
 {
     /**
-     * Set up
-     */
-    protected function setUp()
-    {
-        GeneralUtility::flushInternalRuntimeCaches();
-    }
-
-    /**
      * @test
      */
     public function uploadedFilesAreNormalizedFromFilesSuperGlobal()
index 0ac4c8e..f1757e0 100644 (file)
@@ -19,7 +19,6 @@ use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Resource\FileReference;
 use TYPO3\CMS\Core\Resource\OnlineMedia\Helpers\YouTubeHelper;
 use TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 /**
@@ -38,7 +37,6 @@ class YouTubeRendererTest extends UnitTestCase
     protected function setUp()
     {
         parent::setUp();
-        GeneralUtility::flushInternalRuntimeCaches();
         $_SERVER['HTTP_HOST'] = 'test.server.org';
 
         /** @var YouTubeHelper|\PHPUnit_Framework_MockObject_MockObject $youTubeHelper */
index 6a57dba..67201dd 100644 (file)
@@ -62,7 +62,6 @@ class GeneralUtilityTest extends UnitTestCase
      */
     protected function setUp()
     {
-        GeneralUtilityFixture::flushInternalRuntimeCaches();
         GeneralUtilityFixture::$isAllowedHostHeaderValueCallCount = 0;
         GeneralUtilityFixture::setAllowHostHeaderValue(false);
         $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = GeneralUtility::ENV_TRUSTED_HOSTS_PATTERN_ALLOW_ALL;
@@ -1537,7 +1536,6 @@ class GeneralUtilityTest extends UnitTestCase
      */
     public function getIndpEnvTypo3HostOnlyParsesHostnamesAndIpAdresses($httpHost, $expectedIp)
     {
-        GeneralUtility::flushInternalRuntimeCaches();
         $_SERVER['HTTP_HOST'] = $httpHost;
         $this->assertEquals($expectedIp, GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY'));
     }
@@ -1729,7 +1727,6 @@ class GeneralUtilityTest extends UnitTestCase
     {
         $this->expectException(\UnexpectedValueException::class);
         $this->expectExceptionCode(1396795884);
-
         $_SERVER['HTTP_HOST'] = $httpHost;
         $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = $hostNamePattern;
         GeneralUtilityFixture::getIndpEnv('HTTP_HOST');
@@ -2027,7 +2024,6 @@ class GeneralUtilityTest extends UnitTestCase
     {
         $_SERVER['HTTP_HOST'] = $host;
         $_SERVER['SCRIPT_NAME'] = $subDirectory . 'typo3/index.php';
-        GeneralUtility::flushInternalRuntimeCaches();
         $this->assertEquals($url, GeneralUtility::sanitizeLocalUrl($url));
     }
 
@@ -2042,7 +2038,6 @@ class GeneralUtilityTest extends UnitTestCase
     {
         $_SERVER['HTTP_HOST'] = $host;
         $_SERVER['SCRIPT_NAME'] = $subDirectory . 'typo3/index.php';
-        GeneralUtility::flushInternalRuntimeCaches();
         $this->assertEquals(rawurlencode($url), GeneralUtility::sanitizeLocalUrl(rawurlencode($url)));
     }
 
index 8f71aff..4dbc5d5 100644 (file)
@@ -51,7 +51,7 @@
                "fiunchinho/phpunit-randomizer": "^4.0",
                "friendsofphp/php-cs-fixer": "^2.12.2",
                "typo3/cms-styleguide": "~9.2.0",
-               "typo3/testing-framework": "~4.8.1"
+               "typo3/testing-framework": "~4.8.2"
        },
        "suggest": {
                "ext-fileinfo": "Used for proper file type detection in the file abstraction layer",
index a79ded9..439a6c9 100644 (file)
@@ -393,7 +393,6 @@ class UriBuilderTest extends UnitTestCase
      */
     public function buildBackendUriCreatesAbsoluteUrisIfSpecified()
     {
-        GeneralUtility::flushInternalRuntimeCaches();
         GeneralUtility::_GETset(['route' => '/test/Path']);
         $_SERVER['HTTP_HOST'] = 'baseuri';
         $_SERVER['SCRIPT_NAME'] = '/typo3/index.php';
index 3918734..a5ac9b8 100644 (file)
@@ -18,7 +18,6 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Service;
 use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Resource\FileReference;
 use TYPO3\CMS\Core\Resource\ProcessedFile;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Service\EnvironmentService;
 use TYPO3\CMS\Extbase\Service\ImageService;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
@@ -50,7 +49,6 @@ class ImageScriptServiceTest extends UnitTestCase
     {
         $this->environmentService = $this->createMock(EnvironmentService::class);
         $this->subject = new ImageService($this->environmentService);
-        GeneralUtility::flushInternalRuntimeCaches();
         $_SERVER['HTTP_HOST'] = 'foo.bar';
     }
 
index be3ed60..08adb3a 100644 (file)
@@ -85,7 +85,6 @@ class FrontendLoginControllerTest extends UnitTestCase
      */
     protected function setUpFakeSitePathAndHost()
     {
-        GeneralUtility::flushInternalRuntimeCaches();
         $_SERVER['ORIG_PATH_INFO'] = $_SERVER['PATH_INFO'] = $_SERVER['ORIG_SCRIPT_NAME'] = $_SERVER['SCRIPT_NAME'] = $this->testSitePath . TYPO3_mainDir;
         $_SERVER['HTTP_HOST'] = $this->testHostName;
     }
index 11eaf0f..a573c2f 100644 (file)
@@ -18,7 +18,6 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\Compatibility;
 use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\Http\NormalizedParams;
 use TYPO3\CMS\Core\Http\ServerRequestFactory;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
@@ -37,7 +36,6 @@ class LegacyDomainResolverTest extends UnitTestCase
     {
         parent::setUp();
         $this->subject = $this->getAccessibleMock(LegacyDomainResolver::class, ['dummy'], [], '', false);
-        GeneralUtility::flushInternalRuntimeCaches();
     }
 
     /**
index d5770c1..f179478 100644 (file)
@@ -49,7 +49,6 @@ class ConditionMatcherTest extends UnitTestCase
         $GLOBALS['TYPO3_REQUEST'] = new ServerRequest();
 
         $this->testGlobalNamespace = $this->getUniqueId('TEST');
-        GeneralUtility::flushInternalRuntimeCaches();
         $GLOBALS[$this->testGlobalNamespace] = [];
         $GLOBALS['TSFE'] = new \stdClass();
         $GLOBALS['TSFE']->page = [];
index 0fdfa1c..ef4132e 100644 (file)
@@ -18,7 +18,6 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\Controller;
 use TYPO3\CMS\Core\Context\Context;
 use TYPO3\CMS\Core\Http\ServerRequestFactory;
 use TYPO3\CMS\Core\Page\PageRenderer;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
 use TYPO3\CMS\Frontend\Page\PageRepository;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
@@ -40,7 +39,6 @@ class TypoScriptFrontendControllerTest extends UnitTestCase
 
     protected function setUp()
     {
-        GeneralUtility::flushInternalRuntimeCaches();
         $this->subject = $this->getAccessibleMock(TypoScriptFrontendController::class, ['dummy'], [], '', false);
         $this->subject->_set('context', new Context());
         $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = '170928423746123078941623042360abceb12341234231';
@@ -240,7 +238,6 @@ class TypoScriptFrontendControllerTest extends UnitTestCase
             $this->subject->config = ['config' => ['sword_standAlone' => 1]];
         }
 
-        GeneralUtility::flushInternalRuntimeCaches();
         $request = ServerRequestFactory::fromGlobals();
         $this->subject->preparePageContentGeneration($request);
         $this->assertEquals($this->subject->sWordRegEx, $expectedRegex);
index 714f3c3..d79ad71 100644 (file)
@@ -43,8 +43,6 @@ class AbstractTypolinkBuilderTest extends UnitTestCase
      */
     protected function setUp()
     {
-        GeneralUtility::flushInternalRuntimeCaches();
-
         $this->createMockedLoggerAndLogManager();
 
         $this->frontendControllerMock = $this->getAccessibleMock(
index 758e0ea..88ec859 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Frontend\Tests\UnitDeprecated\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
@@ -32,7 +31,6 @@ class TypoScriptFrontendControllerTest extends UnitTestCase
     protected function setUp()
     {
         parent::setUp();
-        GeneralUtility::flushInternalRuntimeCaches();
         $this->subject = $this->getAccessibleMock(TypoScriptFrontendController::class, ['dummy'], [], '', false);
     }