[TASK] Make frontend/Tests/Unit/Typolink/ tests notice free 96/57896/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 14 Aug 2018 17:11:00 +0000 (19:11 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 14 Aug 2018 17:30:56 +0000 (19:30 +0200)
Resolves: #85846
Releases: master
Change-Id: I9a7338d7bbd706482854c26db8866aaa353bdef7
Reviewed-on: https://review.typo3.org/57896
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/Typolink/AbstractTypolinkBuilder.php
typo3/sysext/frontend/Tests/Unit/Typolink/AbstractTypolinkBuilderTest.php

index eeb1dc1..e19c884 100644 (file)
@@ -1546,7 +1546,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
         }
 
         // Cache handling
-        if (is_array($conf['cache.'])) {
+        if (isset($conf['cache.']) && is_array($conf['cache.'])) {
             $conf['cache.']['key'] = $this->stdWrap($conf['cache.']['key'], $conf['cache.']['key.']);
             $conf['cache.']['tags'] = $this->stdWrap($conf['cache.']['tags'], $conf['cache.']['tags.']);
             $conf['cache.']['lifetime'] = $this->stdWrap($conf['cache.']['lifetime'], $conf['cache.']['lifetime.']);
@@ -1566,7 +1566,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
         // execute each function in the predefined order
         foreach ($sortedConf as $stdWrapName) {
             // eliminate the second key of a pair 'key'|'key.' to make sure functions get called only once and check if rendering has been stopped
-            if (!$isExecuted[$stdWrapName] && !$this->stopRendering[$this->stdWrapRecursionLevel]) {
+            if ((!isset($isExecuted[$stdWrapName]) || !$isExecuted[$stdWrapName]) && !$this->stopRendering[$this->stdWrapRecursionLevel]) {
                 $functionName = rtrim($stdWrapName, '.');
                 $functionProperties = $functionName . '.';
                 $functionType = $this->stdWrapOrder[$functionName];
@@ -1583,7 +1583,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
                     // Get just that part of $conf that is needed for the particular function
                     $singleConf = [
                         $functionName => $conf[$functionName],
-                        $functionProperties => $conf[$functionProperties]
+                        $functionProperties => $conf[$functionProperties] ?? null
                     ];
                     // Hand over the whole $conf array to the stdWrapHookObjects
                     if ($functionType === 'hook') {
index 635290d..1056d4f 100644 (file)
@@ -138,8 +138,8 @@ abstract class AbstractTypolinkBuilder
         } elseif ($targetAttributeAllowed) {
             $target = $fallbackTarget;
         }
-        if ($conf[$name . '.']) {
-            $target = (string)$this->contentObjectRenderer->stdWrap($target, $conf[$name . '.']);
+        if (isset($conf[$name . '.']) && $conf[$name . '.']) {
+            $target = (string)$this->contentObjectRenderer->stdWrap($target, $conf[$name . '.'] ?? []);
         }
         return $target;
     }
index eb1e0f2..714f3c3 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types = 1);
 namespace TYPO3\CMS\Frontend\Tests\Unit\Typolink;
 
 /*
@@ -28,11 +29,6 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 class AbstractTypolinkBuilderTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * @var bool Reset singletons created by subject
      */
     protected $resetSingletonInstances = true;