[BUGFIX] FollowUp to #56660 70/28270/2
authorSteffen Ritter <info@rs-websystems.de>
Tue, 11 Mar 2014 19:09:18 +0000 (20:09 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Tue, 11 Mar 2014 19:17:21 +0000 (20:17 +0100)
Fixes the unit-test according to the changes in review
https://review.typo3.org/#/c/28195/.

Since the BasePath (and therefore vfs://...) cannot be
handover anymore on initialize() it has to be injected
via _set().

Releases: 6.2
Resolves: #56660
Change-Id: I88d03f0305ff08810d6fea82c5c891b1a7a99771
Reviewed-on: https://review.typo3.org/28270
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php

index 4a8a8c8..d817315 100644 (file)
@@ -38,7 +38,7 @@ class PackageManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $mockCache->expects($this->any())->method('set')->will($this->returnValue(TRUE));
                $mockCache->expects($this->any())->method('getBackend')->will($this->returnValue($mockCacheBackend));
                $mockCacheBackend->expects($this->any())->method('getCacheDirectory')->will($this->returnValue('vfs://Test/Cache'));
                $mockCache->expects($this->any())->method('set')->will($this->returnValue(TRUE));
                $mockCache->expects($this->any())->method('getBackend')->will($this->returnValue($mockCacheBackend));
                $mockCacheBackend->expects($this->any())->method('getCacheDirectory')->will($this->returnValue('vfs://Test/Cache'));
-               $this->packageManager = $this->getMock('TYPO3\\CMS\\Core\\Package\\PackageManager', array('sortAndSavePackageStates'));
+               $this->packageManager = $this->getAccessibleMock('TYPO3\\CMS\\Core\\Package\\PackageManager', array('sortAndSavePackageStates'));
 
                mkdir('vfs://Test/Packages/Application', 0700, TRUE);
                mkdir('vfs://Test/Configuration');
 
                mkdir('vfs://Test/Packages/Application', 0700, TRUE);
                mkdir('vfs://Test/Configuration');
@@ -54,7 +54,9 @@ class PackageManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->packageManager->injectClassLoader($mockClassLoader);
                $this->packageManager->injectCoreCache($mockCache);
                $this->inject($this->packageManager, 'composerNameToPackageKeyMap', $composerNameToPackageKeyMap);
                $this->packageManager->injectClassLoader($mockClassLoader);
                $this->packageManager->injectCoreCache($mockCache);
                $this->inject($this->packageManager, 'composerNameToPackageKeyMap', $composerNameToPackageKeyMap);
-               $this->packageManager->initialize($mockBootstrap, 'vfs://Test/Packages/', 'vfs://Test/Configuration/PackageStates.php');
+               $this->packageManager->initialize($mockBootstrap);
+               $this->packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
+               $this->packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
        }
 
        /**
        }
 
        /**