[TASK] typo3/testing-framework now flushes runtime caches 15/58115/3
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:49:03 +0000 (16:49 +0200)
Unit test tearDown() now always calls
GeneralUtility::flushInternalRuntimeCaches() so most explicit
calls in unit tests can be removed.

composer update typo3/testing-framework

Resolves: #85948
Related: #85946
Releases: master, 8.7
Change-Id: I798047a06c3265404383540cacbd40d9719e7bfe
Reviewed-on: https://review.typo3.org/58115
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
13 files changed:
composer.lock
typo3/sysext/backend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.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/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/Functional/Controller/TypoScriptFrontendControllerTest.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

index a7e0bcd..46e4700 100644 (file)
         },
         {
             "name": "typo3/testing-framework",
-            "version": "1.2.6",
+            "version": "1.2.7",
             "source": {
                 "type": "git",
                 "url": "https://github.com/TYPO3/testing-framework.git",
-                "reference": "dd19899367604b1944758dd64ee5a63450e400a5"
+                "reference": "dfed706443fd9008b321a13d6d2522da3ba3dd73"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/dd19899367604b1944758dd64ee5a63450e400a5",
-                "reference": "dd19899367604b1944758dd64ee5a63450e400a5",
+                "url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/dfed706443fd9008b321a13d6d2522da3ba3dd73",
+                "reference": "dfed706443fd9008b321a13d6d2522da3ba3dd73",
                 "shasum": ""
             },
             "require": {
                 "tests",
                 "typo3"
             ],
-            "time": "2018-05-08T20:48:24+00:00"
+            "time": "2018-09-01T14:23:29+00:00"
         },
         {
             "name": "webmozart/assert",
index 03c1957..07a07df 100644 (file)
@@ -52,7 +52,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->getMockBuilder(\TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher::class)
             ->setMethods(['determineRootline'])
index 9a35e8a..cd6b984 100644 (file)
@@ -45,8 +45,6 @@ class AbstractConditionMatcherTest extends \TYPO3\TestingFramework\Core\Unit\Uni
     {
         require_once('Fixtures/ConditionMatcherUserFuncs.php');
 
-        GeneralUtility::flushInternalRuntimeCaches();
-
         $this->backupApplicationContext = GeneralUtility::getApplicationContext();
         $this->conditionMatcher = $this->getMockForAbstractClass(AbstractConditionMatcher::class);
         $this->evaluateConditionCommonMethod = new \ReflectionMethod(AbstractConditionMatcher::class, 'evaluateConditionCommon');
index cf48744..797edf3 100644 (file)
@@ -16,7 +16,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;
 
 /**
  * Testcase for \TYPO3\CMS\Core\Http\ServerRequestFactory
@@ -24,14 +23,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 class ServerRequestFactoryTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
 {
     /**
-     * Set up
-     */
-    protected function setUp()
-    {
-        GeneralUtility::flushInternalRuntimeCaches();
-    }
-
-    /**
      * @test
      */
     public function uploadedFilesAreNormalizedFromFilesSuperGlobal()
index c59413e..811b93c 100644 (file)
@@ -18,7 +18,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;
 
 /**
  * Class YouTubeRendererTest
@@ -36,7 +35,6 @@ class YouTubeRendererTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     protected function setUp()
     {
         parent::setUp();
-        GeneralUtility::flushInternalRuntimeCaches();
         $_SERVER['HTTP_HOST'] = 'test.server.org';
 
         /** @var YouTubeHelper|\PHPUnit_Framework_MockObject_MockObject $youTubeHelper */
index 7c197e2..f9eb826 100644 (file)
@@ -57,7 +57,6 @@ class GeneralUtilityTest extends \TYPO3\TestingFramework\Core\Unit\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;
@@ -1690,7 +1689,6 @@ class GeneralUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
      */
     public function getIndpEnvTypo3HostOnlyParsesHostnamesAndIpAdresses($httpHost, $expectedIp)
     {
-        GeneralUtility::flushInternalRuntimeCaches();
         $_SERVER['HTTP_HOST'] = $httpHost;
         $this->assertEquals($expectedIp, GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY'));
     }
@@ -1904,7 +1902,6 @@ class GeneralUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     {
         $this->expectException(\UnexpectedValueException::class);
         $this->expectExceptionCode(1396795884);
-
         $_SERVER['HTTP_HOST'] = $httpHost;
         $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = $hostNamePattern;
         GeneralUtilityFixture::getIndpEnv('HTTP_HOST');
@@ -2228,7 +2225,6 @@ class GeneralUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     {
         $_SERVER['HTTP_HOST'] = $host;
         $_SERVER['SCRIPT_NAME'] = $subDirectory . 'typo3/index.php';
-        GeneralUtility::flushInternalRuntimeCaches();
         $this->assertEquals($url, GeneralUtility::sanitizeLocalUrl($url));
     }
 
@@ -2243,7 +2239,6 @@ class GeneralUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     {
         $_SERVER['HTTP_HOST'] = $host;
         $_SERVER['SCRIPT_NAME'] = $subDirectory . 'typo3/index.php';
-        GeneralUtility::flushInternalRuntimeCaches();
         $this->assertEquals(rawurlencode($url), GeneralUtility::sanitizeLocalUrl(rawurlencode($url)));
     }
 
index a4cec22..45a846b 100644 (file)
@@ -380,7 +380,6 @@ class UriBuilderTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
      */
     public function buildBackendUriCreatesAbsoluteUrisIfSpecified()
     {
-        GeneralUtility::flushInternalRuntimeCaches();
         GeneralUtility::_GETset(['M' => 'moduleKey']);
         $_SERVER['HTTP_HOST'] = 'baseuri';
         $_SERVER['SCRIPT_NAME'] = '/typo3/index.php';
index c7e4d96..a101ea4 100644 (file)
@@ -17,7 +17,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;
 
@@ -44,7 +43,6 @@ class ImageScriptServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestC
         $this->subject = new ImageService();
         $this->environmentService = $this->createMock(EnvironmentService::class);
         $this->inject($this->subject, 'environmentService', $this->environmentService);
-        GeneralUtility::flushInternalRuntimeCaches();
         $_SERVER['HTTP_HOST'] = 'foo.bar';
     }
 
index 8dade80..2b6841e 100644 (file)
@@ -89,7 +89,6 @@ class FrontendLoginControllerTest extends \TYPO3\TestingFramework\Core\Unit\Unit
      */
     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 03ab52e..4e139ca 100644 (file)
@@ -92,8 +92,6 @@ class TypoScriptFrontendControllerTest extends \TYPO3\TestingFramework\Core\Func
      */
     public function getSysDomainCacheReturnsCurrentDomainRecord($currentDomain)
     {
-        GeneralUtility::flushInternalRuntimeCaches();
-
         $_SERVER['HTTP_HOST'] = $currentDomain;
         $domainRecords = [
             'typo3.org' => [
@@ -151,8 +149,6 @@ class TypoScriptFrontendControllerTest extends \TYPO3\TestingFramework\Core\Func
      */
     public function getSysDomainCacheReturnsForcedDomainRecord($currentDomain)
     {
-        GeneralUtility::flushInternalRuntimeCaches();
-
         $_SERVER['HTTP_HOST'] = $currentDomain;
         $domainRecords = [
             'typo3.org' => [
index db932da..fcab7ff 100644 (file)
@@ -39,7 +39,6 @@ class ConditionMatcherTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCas
     protected function setUp()
     {
         $this->testGlobalNamespace = $this->getUniqueId('TEST');
-        GeneralUtility::flushInternalRuntimeCaches();
         $GLOBALS[$this->testGlobalNamespace] = [];
         $GLOBALS['TSFE'] = new \stdClass();
         $GLOBALS['TSFE']->tmpl = new \stdClass();
index fd22af6..866fdf9 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
 use TYPO3\CMS\Frontend\Page\PageRepository;
 
@@ -30,7 +29,6 @@ class TypoScriptFrontendControllerTest extends \TYPO3\TestingFramework\Core\Unit
 
     protected function setUp()
     {
-        GeneralUtility::flushInternalRuntimeCaches();
         $this->subject = $this->getAccessibleMock(TypoScriptFrontendController::class, ['dummy'], [], '', false);
         $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = '170928423746123078941623042360abceb12341234231';
 
index 892aeed..0ac1311 100644 (file)
@@ -49,8 +49,6 @@ class AbstractTypolinkBuilderTest extends UnitTestCase
      */
     protected function setUp()
     {
-        GeneralUtility::flushInternalRuntimeCaches();
-
         $this->singletonInstances = GeneralUtility::getSingletonInstances();
         $this->createMockedLoggerAndLogManager();