TYPO3 CMS  TYPO3_6-2
All Classes Namespaces Files Functions Variables Pages
RenderViewHelperTest.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is backported from the TYPO3 Flow 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 
22  protected $viewHelper;
23 
24  public function setUp() {
25  parent::setUp();
26  $this->templateVariableContainer = new \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer();
27  $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
28  $this->viewHelper = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\ViewHelpers\\RenderViewHelper', array('dummy'));
29  $this->injectDependenciesIntoViewHelper($this->viewHelper);
30  }
31 
36  $arguments = array(
37  'someArgument' => 'someValue'
38  );
39  $expected = array(
40  'someArgument' => 'someValue',
41  'settings' => 'theSettings'
42  );
43  $this->templateVariableContainer->add('settings', 'theSettings');
44 
45  $actual = $this->viewHelper->_call('loadSettingsIntoArguments', $arguments);
46  $this->assertEquals($expected, $actual);
47  }
48 
53  $arguments = array(
54  'someArgument' => 'someValue',
55  'settings' => 'specifiedSettings'
56  );
57  $expected = array(
58  'someArgument' => 'someValue',
59  'settings' => 'specifiedSettings'
60  );
61  $this->templateVariableContainer->add('settings', 'theSettings');
62 
63  $actual = $this->viewHelper->_call('loadSettingsIntoArguments', $arguments);
64  $this->assertEquals($expected, $actual);
65  }
66 
71  $arguments = array(
72  'someArgument' => 'someValue'
73  );
74  $expected = array(
75  'someArgument' => 'someValue'
76  );
77 
78  $actual = $this->viewHelper->_call('loadSettingsIntoArguments', $arguments);
79  $this->assertEquals($expected, $actual);
80  }
81 }
injectDependenciesIntoViewHelper(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper)
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)