From 0863b02f7953076249da2cb64fc9dea5f71f860f Mon Sep 17 00:00:00 2001 From: Helmut Hummel <helmut.hummel@typo3.org> Date: Thu, 15 Oct 2015 22:26:35 +0200 Subject: [PATCH] [CLEANUP] Simplify PackageMangerTest * 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> --- .../sysext/core/Tests/Unit/Package/PackageManagerTest.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php b/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php index 3066fe569f8c..c53e6ba22e35 100644 --- a/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php +++ b/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php @@ -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); } /** -- GitLab