[FOLLOWUP][BUGFIX] Handle empty pid list in FrontendConfigurationManager 32/45432/3
authorPhilipp Gampe <philipp.gampe@typo3.org>
Wed, 23 Dec 2015 20:40:48 +0000 (21:40 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 23 Dec 2015 20:49:01 +0000 (21:49 +0100)
Add a unit test.

Resolves: #72414
Releases: master, 7.6
Change-Id: Iefff83ae483e4a760a9c7b973e40df50270407d5
Reviewed-on: https://review.typo3.org/45432
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php

index 65045e0..f179794 100644 (file)
@@ -453,6 +453,21 @@ class FrontendConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
     /**
      * @test
      */
+    public function overrideStoragePidIfStartingPointIsSetCorrectlyHandlesEmptyValuesFromGetTreeList()
+    {
+        $this->mockContentObject->expects($this->any())->method('getTreeList')->will($this->returnValue(''));
+        $this->mockContentObject->data = array('pages' => '0', 'recursive' => 1);
+
+        $frameworkConfiguration = array('persistence' => array('storagePid' => '98'));
+        $this->assertSame(
+            array('persistence' => array('storagePid' => '0')),
+            $this->frontendConfigurationManager->_call('overrideStoragePidIfStartingPointIsSet', $frameworkConfiguration)
+        );
+    }
+
+    /**
+     * @test
+     */
     public function overrideConfigurationFromFlexFormChecksForDataIsString()
     {
         /** @var $flexFormService \TYPO3\CMS\Extbase\Service\FlexFormService|\PHPUnit_Framework_MockObject_MockObject */