TYPO3 CMS  TYPO3_6-2
All Classes Namespaces Files Functions Variables Pages
RenderingContextTest.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is backported from the FLOW3 package "TYPO3.Fluid". *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * The TYPO3 project - inspiring people to share! *
12  * */
13 
18 
24  protected $renderingContext;
25 
26  public function setUp() {
27  $this->renderingContext = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext', array('dummy'));
28  }
29 
34  $templateVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer');
35  $this->renderingContext->injectTemplateVariableContainer($templateVariableContainer);
36  $this->assertSame($this->renderingContext->getTemplateVariableContainer(), $templateVariableContainer, 'Template Variable Container could not be read out again.');
37  }
38 
43  $controllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
44  $this->renderingContext->setControllerContext($controllerContext);
45  $this->assertSame($this->renderingContext->getControllerContext(), $controllerContext);
46  }
47 
52  $viewHelperVariableContainer = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
53  $this->renderingContext->_set('viewHelperVariableContainer', $viewHelperVariableContainer);
54  $this->assertSame($viewHelperVariableContainer, $this->renderingContext->getViewHelperVariableContainer());
55  }
56 }
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)