[BUGFIX] Incomplete mocking in Bootstrap test
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 29 Apr 2013 20:10:49 +0000 (22:10 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 29 Apr 2013 20:14:25 +0000 (22:14 +0200)
ReflectionService is not properly mocked in one of the extbase
bootstrap tests and can raise a warning (in travis) that some
related database table does not exist.

Change-Id: Iadf021887b1636d0147ef5d75e63edf290bfeceb
Releases: 6.2, 6.1
Resolves: #47715
Related: #39140
Reviewed-on: https://review.typo3.org/20326
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extbase/Tests/Unit/Core/BootstrapTest.php

index 8d94f5f..a32556e 100644 (file)
@@ -94,8 +94,12 @@ class BootstrapTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                /** @var $cliResponse \TYPO3\CMS\Extbase\Mvc\Cli\Response */
                $cliResponse = $this->getMock('TYPO3\CMS\Extbase\Mvc\Cli\Response', array('send'));
 
+               /** @var $reflectionServiceMock \TYPO3\CMS\Extbase\Reflection\ReflectionService */
+               $reflectionServiceMock = $this->getMock('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService', array(), array(), '', FALSE);
+
                /** @var $bootstrap \TYPO3\CMS\Extbase\Core\Bootstrap |\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
-               $bootstrap = $this->getAccessibleMock('TYPO3\CMS\Extbase\Core\Bootstrap', array('isInCliMode'));
+               $bootstrap = $this->getAccessibleMock('TYPO3\CMS\Extbase\Core\Bootstrap', array('isInCliMode', 'initializeReflection'));
+               $bootstrap->_set('reflectionService', $reflectionServiceMock);
                $bootstrap->expects($this->once())->method('isInCliMode')->will($this->returnValue(TRUE));
 
                $requestHandlerResolver->expects($this->once())->method('resolveRequestHandler')->will($this->returnValue($cliRequestHandler));