[CLEANUP] Simplify PackageMangerTest 93/44093/6
authorHelmut Hummel <helmut.hummel@typo3.org>
Thu, 15 Oct 2015 20:26:35 +0000 (22:26 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 15 Oct 2015 20:34:26 +0000 (22:34 +0200)
* Remove not needed initialization
* Remove not needed mock
* Fix name of a method that must be mocked

Resolves: #70778
Releases: master
Change-Id: I579feae7fedde190980758563c87116e695efd92
Reviewed-on: http://review.typo3.org/44093
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php

index 3066fe5..c53e6ba 100644 (file)
@@ -38,10 +38,6 @@ class PackageManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     {
         vfsStream::setup('Test');
 
-        /** @var Bootstrap|\PHPUnit_Framework_MockObject_MockObject $mockBootstrap */
-        $mockBootstrap = $this->getMock(Bootstrap::class, array(), array(), '', false);
-        $mockBootstrap->method('usesComposerClassLoading')->will($this->returnValue(FALSE));
-
         /** @var PhpFrontend|\PHPUnit_Framework_MockObject_MockObject $mockCache */
         $mockCache = $this->getMock(PhpFrontend::class, array('has', 'set', 'getBackend'), array(), '', false);
         $mockCacheBackend = $this->getMock(SimpleFileBackend::class, array('has', 'set', 'getBackend'), array(), '', false);
@@ -49,7 +45,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'));
-        $this->packageManager = $this->getAccessibleMock(PackageManager::class, array('sortAndSavePackageStates', 'sortAvailablePackagesByDependencies', 'registerAutoloadInformationInClassLoader'));
+        $this->packageManager = $this->getAccessibleMock(PackageManager::class, array('sortAndSavePackageStates', 'sortAvailablePackagesByDependencies', 'registerTransientClassLoadingInformationForPackage'));
 
         mkdir('vfs://Test/Packages/Application', 0700, true);
         mkdir('vfs://Test/Configuration');
@@ -63,7 +59,6 @@ class PackageManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $this->inject($this->packageManager, 'composerNameToPackageKeyMap', $composerNameToPackageKeyMap);
         $this->packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
         $this->packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
-        $this->packageManager->initialize($mockBootstrap);
     }
 
     /**