[BUGFIX] storagePid is lost when persistence.recursive is set
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / Configuration / AbstractConfigurationManagerTest.php
index f504141..e148efe 100644 (file)
@@ -307,6 +307,36 @@ class AbstractConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\Bas
                $this->assertEquals($expectedResult, $actualResult);
        }
 
+       /**
+        * @test
+        */
+       public function getConfigurationRetrievesStoragePidIncludingGivenStoragePidWithRecursiveSetForSingleStoragePid() {
+               $pluginConfiguration = array(
+                       'persistence' => array(
+                               'storagePid' => 1,
+                               'recursive' => 99
+                       )
+               );
+               $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->will($this->returnValue($pluginConfiguration));
+               $this->abstractConfigurationManager->expects($this->once())->method('getRecursiveStoragePids')->with('-1');
+               $this->abstractConfigurationManager->getConfiguration('SomeOtherExtensionName', 'SomeOtherCurrentPluginName');
+       }
+
+       /**
+        * @test
+        */
+       public function getConfigurationRetrievesStoragePidIncludingGivenStoragePidWithRecursiveSetForMultipleStoragePid() {
+               $pluginConfiguration = array(
+                       'persistence' => array(
+                               'storagePid' => '1,25',
+                               'recursive' => 99
+                       )
+               );
+               $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->will($this->returnValue($pluginConfiguration));
+               $this->abstractConfigurationManager->expects($this->once())->method('getRecursiveStoragePids')->with('-1,-25');
+               $this->abstractConfigurationManager->getConfiguration('SomeOtherExtensionName', 'SomeOtherCurrentPluginName');
+       }
+
        /**
         * switchableControllerActions *
         */