[BUGFIX] InvalidArgumentException in ActionControllerTest 00/28300/2
authorOliver Hader <oliver@typo3.org>
Wed, 12 Mar 2014 15:16:26 +0000 (16:16 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 12 Mar 2014 15:39:33 +0000 (16:39 +0100)
The cache identifier causing the exception looks like this:
randomviewobjectpattern_@package_mycontroller_myaction_myformat

However, "@package" should be "@extension" in that regard and
besides that, the cache identifier using the vendor names shall
be used in the tests.

Resolves: #56822
Releases: 6.2
Change-Id: Ic78a8690559486efcbc7f5da7219a445f3f6707f
Reviewed-on: https://review.typo3.org/28300
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Markus Klein
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ActionControllerTest.php

index 5a5bba2..58a5bab 100644 (file)
@@ -225,6 +225,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function resolveViewObjectNameUsesViewObjectNamePatternToResolveViewObjectName() {
                $mockRequest = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Request', array(), array(), '', FALSE);
+               $mockRequest->expects($this->once())->method('getControllerVendorName')->will($this->returnValue('MyVendor'));
                $mockRequest->expects($this->once())->method('getControllerExtensionName')->will($this->returnValue('MyPackage'));
                $mockRequest->expects($this->once())->method('getControllerName')->will($this->returnValue('MyController'));
                $mockRequest->expects($this->once())->method('getControllerActionName')->will($this->returnValue('MyAction'));
@@ -233,7 +234,7 @@ class ActionControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
                $mockController = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController', array('dummy'), array(), '', FALSE);
                $mockController->_set('request', $mockRequest);
                $mockController->_set('objectManager', $mockObjectManager);
-               $mockController->_set('viewObjectNamePattern', 'RandomViewObjectPattern_@package_@controller_@action_@format');
+               $mockController->_set('namespacesViewObjectNamePattern', 'RandomViewObject@vendor\@extension\View\@controller\@action@format');
                $mockController->_call('resolveViewObjectName');
        }