[BUGFIX] Fix incomplete mocking in several tests 66/28666/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Sun, 23 Mar 2014 13:23:03 +0000 (14:23 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 23 Mar 2014 13:25:35 +0000 (14:25 +0100)
IndexerServiceTest and ExtensionManagementServiceTest
both execute emit signal methods which in turn
try to instantiate the SignalSlotDispatcher,
which can fail.

Resolve this by mocking these methods.

Resolves: #57206
Releases: 6.2
Change-Id: I0a239abeb7c94839a413870c58f22ae59fed8470
Reviewed-on: https://review.typo3.org/28666
Reviewed-by: Markus Klein
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Tests/Unit/Resource/Service/IndexerServiceTest.php
typo3/sysext/extensionmanager/Tests/Unit/Service/ExtensionManagementServiceTest.php

index 8f76afc..a29865f 100644 (file)
@@ -71,7 +71,7 @@ class IndexerServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function indexFileSetsCreationdateAndTimestampPropertiesOfRecordToCurrentExecutionTime() {
                $fileInfo = array();
                /** @var $subject \TYPO3\CMS\Core\Resource\Service\IndexerService|\PHPUnit_Framework_MockObject_MockObject */
-               $subject = $this->getMock('TYPO3\\CMS\\Core\\Resource\\Service\\IndexerService', array('gatherFileInformation', 'getFileIndexRepository'));
+               $subject = $this->getMock('TYPO3\\CMS\\Core\\Resource\\Service\\IndexerService', array('gatherFileInformation', 'getFileIndexRepository', 'emitPreFileIndexSignal', 'emitPostFileIndexSignal'));
 
                $subject->expects($this->any())->method('gatherFileInformation')->will($this->returnValue($fileInfo));
 
index f8c64ff..37967db 100644 (file)
@@ -201,7 +201,7 @@ class ExtensionManagementServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
        public function installDependenciesCallsInstall() {
                $managementMock = $this->getAccessibleMock(
                        'TYPO3\\CMS\\Extensionmanager\\Service\\ExtensionManagementService',
-                       array('dummy')
+                       array('emitWillInstallExtensions')
                );
                $installQueue = array(
                        'foobar' => array(
@@ -224,7 +224,7 @@ class ExtensionManagementServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function installDependenciesReturnsResolvedDependencies() {
                $managementMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Service\\ExtensionManagementService', array(
-                       'dummy'
+                       'emitWillInstallExtensions'
                ));
                $installQueue = array(
                        'foobar' => 'foobar'