[FEATURE] Allow fallback paths in FLUIDTEMPLATE 43/34343/3
authorMarkus Klein <klein.t3@reelworx.at>
Wed, 19 Nov 2014 12:40:38 +0000 (13:40 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Thu, 20 Nov 2014 22:47:02 +0000 (23:47 +0100)
Resolves: #61361
Releases: master, 6.2
Change-Id: I676722936892f164ae147d7f9abcb602e734ae7d
Reviewed-on: http://review.typo3.org/34343
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/core/Documentation/Changelog/master/Feature-61361-FallbackTemplatePathsForFluidStandaloneView.rst
typo3/sysext/frontend/Classes/ContentObject/FluidTemplateContentObject.php
typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php

index 916d534..dc46d0c 100644 (file)
@@ -1,10 +1,13 @@
-=================================================================
-Feature: #61361 - Template Path Fallback for Fluid StandaloneView
-=================================================================
+===================================================================================
+Feature: #61361 - Template Path Fallback for Fluid StandaloneView and FLUIDTEMPLATE
+===================================================================================
 
 Description
 ===========
 
+StandaloneView
+--------------
+
 Earlier in the development of Fluid, a template fallback was introduced
 in the TemplateView, providing the possibility to pass a set of possible
 file locations to the View Configuration, where Templates, Layouts and Partials
@@ -41,10 +44,35 @@ of the keys. The paths are searched from bottom to top.
 In case you choose for numeric array keys, the array is ordered first, then reversed for the lookup, so
 the highest index is accessed first.
 
+FLUIDTEMPLATE
+-------------
+
+Additionally the TypoScript Content Object FLUIDTEMPLATE, which is based on StandaloneView, also supports this
+kind of fallback mechanism.
+Two new TypoScript options are added for this purpose:
+
+ * partialRootPaths
+ * layoutRootPaths
+
+Example usage:
+
+::
+page.10 = FLUIDTEMPLATE
+page.10.file = EXT:sitedesign/Resources/Private/Templates/Main.html
+page.10.partialRootPaths {
+  10 = EXT:sitedesign/Resources/Private/Partials
+  20 = EXT:sitemodification/Resources/Private/Partials
+}
+..
+
+In case you're using the old options (partialRootPath, layoutRootPath) together with the new options, the content of
+the old options will be placed at the first position (index zero) in the fallback list.
+
+
 Impact
 ======
 
 In order to change the skin of an extension output, provided by the Fluid StandaloneView, you are no longer required to
 copy the whole Resources folder into fileadmin or to some specific location, but you can pick only the files you want
 to change. Those need to be organized in folders, which are then configured for the view. The system will fall through
-all the provided locations, taking the first fitting file it finds.
\ No newline at end of file
+all the provided locations, taking the first fitting file it finds.
index 621a08d..d2fd32d 100644 (file)
@@ -34,21 +34,12 @@ class FluidTemplateContentObject extends AbstractContentObject {
        protected $view = NULL;
 
        /**
-        * Constructor
-        *
-        * @param ContentObjectRenderer $contentObjectRenderer
-        */
-       public function __construct(ContentObjectRenderer $contentObjectRenderer) {
-               parent::__construct($contentObjectRenderer);
-       }
-
-       /**
         * Rendering the cObject, FLUIDTEMPLATE
         *
         * Configuration properties:
         * - file string+stdWrap The FLUID template file
-        * - layoutRootPath filepath+stdWrap Root path to layouts
-        * - partialRootPath filepath+stdWrap Root path to partial
+        * - layoutRootPaths array of filepath+stdWrap Root paths to layouts (fallback)
+        * - partialRootPaths filepath+stdWrap Root paths to partials (fallback)
         * - variable array of cObjects, the keys are the variable names in fluid
         * - extbase.pluginName
         * - extbase.controllerExtensionName
@@ -59,7 +50,7 @@ class FluidTemplateContentObject extends AbstractContentObject {
         * 10 = FLUIDTEMPLATE
         * 10.template = FILE
         * 10.template.file = fileadmin/templates/mytemplate.html
-        * 10.partialRootPath = fileadmin/templates/partial/
+        * 10.partialRootPaths.10 = fileadmin/templates/partial/
         * 10.variables {
         *   mylabel = TEXT
         *   mylabel.value = Label from TypoScript coming
@@ -134,10 +125,20 @@ class FluidTemplateContentObject extends AbstractContentObject {
         */
        protected function setLayoutRootPath(array $conf) {
                // Override the default layout path via typoscript
-               $layoutRootPath = isset($conf['layoutRootPath.']) ? $this->cObj->stdWrap($conf['layoutRootPath'], $conf['layoutRootPath.']) : $conf['layoutRootPath'];
-               if ($layoutRootPath) {
-                       $layoutRootPath = GeneralUtility::getFileAbsFileName($layoutRootPath);
-                       $this->view->setLayoutRootPaths(array($layoutRootPath));
+               $layoutPaths = array();
+               if (isset($conf['layoutRootPath']) || isset($conf['layoutRootPath.'])) {
+                       $layoutRootPath = isset($conf['layoutRootPath.'])
+                               ? $this->cObj->stdWrap($conf['layoutRootPath'], $conf['layoutRootPath.'])
+                               : $conf['layoutRootPath'];
+                       $layoutPaths[] = GeneralUtility::getFileAbsFileName($layoutRootPath);
+               }
+               if (isset($conf['layoutRootPaths.'])) {
+                       foreach ($conf['layoutRootPaths.'] as $key => $path) {
+                               $layoutPaths[$key] = GeneralUtility::getFileAbsFileName($path);
+                       }
+               }
+               if (!empty($layoutPaths)) {
+                       $this->view->setLayoutRootPaths($layoutPaths);
                }
        }
 
@@ -148,10 +149,20 @@ class FluidTemplateContentObject extends AbstractContentObject {
         * @return void
         */
        protected function setPartialRootPath(array $conf) {
-               $partialRootPath = isset($conf['partialRootPath.']) ? $this->cObj->stdWrap($conf['partialRootPath'], $conf['partialRootPath.']) : $conf['partialRootPath'];
-               if ($partialRootPath) {
-                       $partialRootPath = GeneralUtility::getFileAbsFileName($partialRootPath);
-                       $this->view->setPartialRootPaths(array($partialRootPath));
+               $partialPaths = array();
+               if (isset($conf['partialRootPath']) || isset($conf['partialRootPath.'])) {
+                       $partialRootPath = isset($conf['partialRootPath.'])
+                               ? $this->cObj->stdWrap($conf['partialRootPath'], $conf['partialRootPath.'])
+                               : $conf['partialRootPath'];
+                       $partialPaths[] = GeneralUtility::getFileAbsFileName($partialRootPath);
+               }
+               if (isset($conf['partialRootPaths.'])) {
+                       foreach ($conf['partialRootPaths.'] as $key => $path) {
+                               $partialPaths[$key] = GeneralUtility::getFileAbsFileName($path);
+                       }
+               }
+               if (!empty($partialPaths)) {
+                       $this->view->setPartialRootPaths($partialPaths);
                }
        }
 
@@ -231,7 +242,7 @@ class FluidTemplateContentObject extends AbstractContentObject {
         * @return void
         */
        protected function assignSettings(array $conf) {
-               if (array_key_exists('settings.', $conf)) {
+               if (isset($conf['settings.'])) {
                        /** @var $typoScriptService TypoScriptService */
                        $typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class);
                        $settings = $typoScriptService->convertTypoScriptArrayToPlainArray($conf['settings.']);
index 6f26546..0cd3436 100644 (file)
@@ -14,7 +14,11 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\ContentObject;
  * The TYPO3 project - inspiring people to share!
  */
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Mvc\Request;
 use TYPO3\CMS\Extbase\Service\TypoScriptService;
+use TYPO3\CMS\Fluid\View\StandaloneView;
+use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
+use TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject;
 
 /**
  * Testcase
@@ -29,22 +33,22 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
        protected $singletonInstances = array();
 
        /**
-        * @var \TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
+        * @var FluidTemplateContentObject|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
         */
-       protected $fixture = NULL;
+       protected $subject = NULL;
 
        /**
-        * @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer|\PHPUnit_Framework_MockObject_MockObject
+        * @var ContentObjectRenderer|\PHPUnit_Framework_MockObject_MockObject
         */
        protected $contentObjectRenderer = NULL;
 
        /**
-        * @var \TYPO3\CMS\Fluid\View\StandaloneView|\PHPUnit_Framework_MockObject_MockObject
+        * @var StandaloneView|\PHPUnit_Framework_MockObject_MockObject
         */
        protected $standaloneView = NULL;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Mvc\Request|\PHPUnit_Framework_MockObject_MockObject
+        * @var Request|\PHPUnit_Framework_MockObject_MockObject
         */
        protected $request = NULL;
 
@@ -56,7 +60,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $this->contentObjectRenderer = $this->getMock(
                        'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'
                );
-               $this->fixture = $this->getAccessibleMock(
+               $this->subject = $this->getAccessibleMock(
                        'TYPO3\\CMS\\Frontend\\ContentObject\\FluidTemplateContentObject',
                        array('dummy', 'initializeStandaloneViewInstance'),
                        array($this->contentObjectRenderer)
@@ -76,67 +80,67 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
        }
 
        /**
-        * Add a mock standalone view to fixture
+        * Add a mock standalone view to subject
         */
-       protected function addMockViewToFixture() {
+       protected function addMockViewToSubject() {
                $this->standaloneView = $this->getMock('TYPO3\\CMS\\Fluid\\View\\StandaloneView', array(), array(), '', FALSE);
                $this->request = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Request');
                $this->standaloneView
                        ->expects($this->any())
                        ->method('getRequest')
                        ->will($this->returnValue($this->request));
-               $this->fixture->_set('view', $this->standaloneView);
+               $this->subject->_set('view', $this->standaloneView);
        }
 
        /**
         * @test
         */
        public function constructSetsContentObjectRenderer() {
-               $this->assertSame($this->contentObjectRenderer, $this->fixture->getContentObject());
+               $this->assertSame($this->contentObjectRenderer, $this->subject->getContentObject());
        }
 
        /**
         * @test
         */
        public function renderCallsInitializeStandaloneViewInstance() {
-               $this->addMockViewToFixture();
-               $this->fixture
+               $this->addMockViewToSubject();
+               $this->subject
                        ->expects($this->once())
                        ->method('initializeStandaloneViewInstance');
-               $this->fixture->render(array());
+               $this->subject->render(array());
        }
 
        /**
         * @test
         */
        public function renderCallsTemplateServiceGetFileNameForGivenTemplateFile() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                /** @var $templateService \PHPUnit_Framework_MockObject_MockObject */
                $templateService = $GLOBALS['TSFE']->tmpl;
                $templateService
                        ->expects($this->any())
                        ->method('getFileName')
                        ->with('foo');
-               $this->fixture->render(array('file' => 'foo'));
+               $this->subject->render(array('file' => 'foo'));
        }
 
        /**
         * @test
         */
        public function renderCallsStandardWrapForGivenTemplateFileWithStandardWrap() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->contentObjectRenderer
                        ->expects($this->any())
                        ->method('stdWrap')
                        ->with('foo', array('bar' => 'baz'));
-               $this->fixture->render(array('file' => 'foo', 'file.' => array('bar' => 'baz')));
+               $this->subject->render(array('file' => 'foo', 'file.' => array('bar' => 'baz')));
        }
 
        /**
         * @test
         */
        public function renderSetsTemplateFileInView() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                /** @var $templateService \PHPUnit_Framework_MockObject_MockObject */
                $templateService = $GLOBALS['TSFE']->tmpl;
                $templateService
@@ -148,14 +152,14 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                        ->expects($this->any())
                        ->method('setTemplatePathAndFilename')
                        ->with('bar');
-               $this->fixture->render(array('file' => 'foo'));
+               $this->subject->render(array('file' => 'foo'));
        }
 
        /**
         * @test
         */
        public function renderSetsTemplateFileByTemplateInView() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
 
                $this->contentObjectRenderer
                        ->expects($this->any())
@@ -168,7 +172,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                        ->method('setTemplateSource')
                        ->with('baz');
 
-               $this->fixture->render(array(
+               $this->subject->render(array(
                        'template' => 'FILE',
                        'template.' => array(
                                'file' => PATH_site . 'foo/bar.html'
@@ -180,79 +184,128 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function renderSetsLayoutRootPathInView() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->standaloneView
                        ->expects($this->once())
                        ->method('setLayoutRootPaths')
                        ->with(array(PATH_site . 'foo/bar.html'));
-               $this->fixture->render(array('layoutRootPath' => 'foo/bar.html'));
+               $this->subject->render(array('layoutRootPath' => 'foo/bar.html'));
        }
 
        /**
         * @test
         */
        public function renderCallsStandardWrapForLayoutRootPath() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->contentObjectRenderer
                        ->expects($this->once())
                        ->method('stdWrap')
                        ->with('foo', array('bar' => 'baz'));
-               $this->fixture->render(array('layoutRootPath' => 'foo', 'layoutRootPath.' => array('bar' => 'baz')));
+               $this->subject->render(array('layoutRootPath' => 'foo', 'layoutRootPath.' => array('bar' => 'baz')));
+       }
+
+       /**
+        * @test
+        */
+       public function fallbacksForLayoutRootPathAreSet() {
+               $this->addMockViewToSubject();
+               $this->standaloneView
+                       ->expects($this->once())
+                       ->method('setLayoutRootPaths')
+                       ->with(array(10 => PATH_site . 'foo/bar.html', 20 => PATH_site . 'foo/bar2.html'));
+               $this->subject->render(array('layoutRootPaths.' => array(10 => 'foo/bar.html', 20 => 'foo/bar2.html')));
+       }
+
+       /**
+        * @test
+        */
+       public function fallbacksForLayoutRootPathAreAppendedToLayoutRootPath() {
+               $this->addMockViewToSubject();
+               $this->standaloneView
+                       ->expects($this->once())
+                       ->method('setLayoutRootPaths')
+                       ->with(array(0 => PATH_site . 'foo/main.html', 10 => PATH_site . 'foo/bar.html', 20 => PATH_site . 'foo/bar2.html'));
+               $this->subject->render(array('layoutRootPath' => 'foo/main.html', 'layoutRootPaths.' => array(10 => 'foo/bar.html', 20 => 'foo/bar2.html')));
        }
 
        /**
         * @test
         */
        public function renderSetsPartialRootPathInView() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->standaloneView
                        ->expects($this->once())
                        ->method('setPartialRootPaths')
                        ->with(array(PATH_site . 'foo/bar.html'));
-               $this->fixture->render(array('partialRootPath' => 'foo/bar.html'));
+               $this->subject->render(array('partialRootPath' => 'foo/bar.html'));
        }
 
        /**
         * @test
         */
        public function renderCallsStandardWrapForPartialRootPath() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->contentObjectRenderer
                        ->expects($this->once())
                        ->method('stdWrap')
                        ->with('foo', array('bar' => 'baz'));
-               $this->fixture->render(array('partialRootPath' => 'foo', 'partialRootPath.' => array('bar' => 'baz')));
+               $this->subject->render(array('partialRootPath' => 'foo', 'partialRootPath.' => array('bar' => 'baz')));
+       }
+
+
+       /**
+        * @test
+        */
+       public function fallbacksForPartialRootPathAreSet() {
+               $this->addMockViewToSubject();
+               $this->standaloneView
+                       ->expects($this->once())
+                       ->method('setPartialRootPaths')
+                       ->with(array(10 => PATH_site . 'foo', 20 => PATH_site . 'bar'));
+               $this->subject->render(array('partialRootPaths.' => array(10 => 'foo', 20 => 'bar')));
+       }
+
+       /**
+        * @test
+        */
+       public function fallbacksForPartialRootPathAreAppendedToPartialRootPath() {
+               $this->addMockViewToSubject();
+               $this->standaloneView
+                       ->expects($this->once())
+                       ->method('setPartialRootPaths')
+                       ->with(array(0 => PATH_site . 'main', 10 => PATH_site . 'foo', 20 => PATH_site . 'bar'));
+               $this->subject->render(array('partialRootPath' => 'main', 'partialRootPaths.' => array(10 => 'foo', 20 => 'bar')));
        }
 
        /**
         * @test
         */
        public function renderSetsFormatInView() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->standaloneView
                        ->expects($this->once())
                        ->method('setFormat')
                        ->with('xml');
-               $this->fixture->render(array('format' => 'xml'));
+               $this->subject->render(array('format' => 'xml'));
        }
 
        /**
         * @test
         */
        public function renderCallsStandardWrapForFormat() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->contentObjectRenderer
                        ->expects($this->once())
                        ->method('stdWrap')
                        ->with('foo', array('bar' => 'baz'));
-               $this->fixture->render(array('format' => 'foo', 'format.' => array('bar' => 'baz')));
+               $this->subject->render(array('format' => 'foo', 'format.' => array('bar' => 'baz')));
        }
 
        /**
         * @test
         */
        public function renderSetsExtbasePluginNameInRequest() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->request
                        ->expects($this->once())
                        ->method('setPluginName')
@@ -262,14 +315,14 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                                'pluginName' => 'foo',
                        ),
                );
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
         * @test
         */
        public function renderCallsStandardWrapForExtbasePluginName() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->contentObjectRenderer
                        ->expects($this->once())
                        ->method('stdWrap')
@@ -282,14 +335,14 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                                ),
                        ),
                );
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
         * @test
         */
        public function renderSetsExtbaseControllerExtensionNameInRequest() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->request
                        ->expects($this->once())
                        ->method('setControllerExtensionName')
@@ -299,14 +352,14 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                                'controllerExtensionName' => 'foo',
                        ),
                );
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
         * @test
         */
        public function renderCallsStandardWrapForExtbaseControllerExtensionName() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->contentObjectRenderer
                        ->expects($this->once())
                        ->method('stdWrap')
@@ -319,14 +372,14 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                                ),
                        ),
                );
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
         * @test
         */
        public function renderSetsExtbaseControllerNameInRequest() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->request
                        ->expects($this->once())
                        ->method('setControllerName')
@@ -336,14 +389,14 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                                'controllerName' => 'foo',
                        ),
                );
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
         * @test
         */
        public function renderCallsStandardWrapForExtbaseControllerName() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->contentObjectRenderer
                        ->expects($this->once())
                        ->method('stdWrap')
@@ -356,14 +409,14 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                                ),
                        ),
                );
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
         * @test
         */
        public function renderSetsExtbaseControllerActionNameInRequest() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->request
                        ->expects($this->once())
                        ->method('setControllerActionName')
@@ -373,14 +426,14 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                                'controllerActionName' => 'foo',
                        ),
                );
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
         * @test
         */
        public function renderCallsStandardWrapForExtbaseControllerActionName() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->contentObjectRenderer
                        ->expects($this->once())
                        ->method('stdWrap')
@@ -393,14 +446,14 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                                ),
                        ),
                );
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
         * @test
         */
        public function renderAssignsSettingsArrayToView() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
 
                $configuration = array(
                        'settings.' => array(
@@ -432,7 +485,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                        ->method('assign')
                        ->with('settings', $expectedSettingsToBeSet);
 
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
@@ -440,7 +493,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @expectedException \InvalidArgumentException
         */
        public function renderThrowsExceptionForNotAllowedVariableData() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $configuration = array(
                        'variables.' => array(
                                'data' => 'foo',
@@ -449,7 +502,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                                ),
                        ),
                );
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
@@ -457,7 +510,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @expectedException \InvalidArgumentException
         */
        public function renderThrowsExceptionForNotAllowedVariableCurrent() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $configuration = array(
                        'variables.' => array(
                                'current' => 'foo',
@@ -466,14 +519,14 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                                ),
                        ),
                );
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
         * @test
         */
        public function renderCallsCObjGetSingleForAllowedVariable() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $configuration = array(
                        'variables.' => array(
                                'aVar' => 'TEXT',
@@ -486,14 +539,14 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                        ->expects($this->once())
                        ->method('cObjGetSingle')
                        ->with('TEXT', array('value' => 'foo'));
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
         * @test
         */
        public function renderAssignsRenderedContentObjectVariableToView() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $configuration = array(
                        'variables.' => array(
                                'aVar' => 'TEXT',
@@ -510,52 +563,52 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                        ->expects($this->at(1))
                        ->method('assign')
                        ->with('aVar', 'foo');
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 
        /**
         * @test
         */
        public function renderAssignsContentObjectRendererDataToView() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->contentObjectRenderer->data = array('foo');
                $this->standaloneView
                        ->expects($this->at(1))
                        ->method('assign')
                        ->with('data', array('foo'));
-               $this->fixture->render(array());
+               $this->subject->render(array());
        }
 
        /**
         * @test
         */
        public function renderAssignsContentObjectRendererCurrentValueToView() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->contentObjectRenderer->data = array('currentKey' => 'currentValue');
                $this->contentObjectRenderer->currentValKey= 'currentKey';
                $this->standaloneView
                        ->expects($this->at(2))
                        ->method('assign')
                        ->with('current', 'currentValue');
-               $this->fixture->render(array());
+               $this->subject->render(array());
        }
 
        /**
         * @test
         */
        public function renderCallsRenderOnStandaloneViewie() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $this->standaloneView
                        ->expects($this->once())
                        ->method('render');
-               $this->fixture->render(array());
+               $this->subject->render(array());
        }
 
        /**
         * @test
         */
        public function renderCallsStandardWrapOnResultStringIfGivenInConfiguration() {
-               $this->addMockViewToFixture();
+               $this->addMockViewToSubject();
                $configuration = array(
                        'stdWrap.' => array(
                                'foo' => 'bar',
@@ -569,6 +622,6 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                        ->expects($this->once())
                        ->method('stdWrap')
                        ->with('baz', array('foo' => 'bar'));
-               $this->fixture->render($configuration);
+               $this->subject->render($configuration);
        }
 }