[~FEATURE] Fluid (ViewHelpers): Adjusted AbstractFormViewHelper to be able to namespa...
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Tests / ViewHelpers / Form / ErrorsViewHelperTest_testcase.php
1 <?php
2
3 /* *
4 * This script belongs to the FLOW3 package "Fluid". *
5 * *
6 * It is free software; you can redistribute it and/or modify it under *
7 * the terms of the GNU General Public License as published by the Free *
8 * Software Foundation, either version 3 of the License, or (at your *
9 * option) any later version. *
10 * *
11 * This script is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
14 * Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with the script. *
18 * If not, see http://www.gnu.org/licenses/gpl.html *
19 * *
20 * The TYPO3 project - inspiring people to share! *
21 * */
22
23 /**
24 */
25
26 include_once(dirname(__FILE__) . '/../Fixtures/ConstraintSyntaxTreeNode.php');
27 require_once(dirname(__FILE__) . '/../ViewHelperBaseTestcase.php');
28
29 /**
30 * @version $Id:$
31 */
32 require_once(t3lib_extMgm::extPath('extbase', 'Tests/Base_testcase.php'));
33 class Tx_Fluid_ViewHelpers_Form_ErrorsViewHelperTest_testcase extends Tx_Fluid_ViewHelpers_ViewHelperBaseTestcase {
34 /**
35 * @test
36 * @author Christopher Hlubek <hlubek@networkteam.com>
37 */
38 public function renderWithoutSpecifiedNameLoopsThroughRootErrors() {
39 $mockError1 = $this->getMock('Tx_Extbase_Error_Error', array(), array(), '', FALSE);
40 $mockError2 = $this->getMock('Tx_Extbase_Error_Error', array(), array(), '', FALSE);
41 $this->request->expects($this->atLeastOnce())->method('getErrors')->will($this->returnValue(array($mockError1, $mockError2)));
42
43 $viewHelper = new Tx_Fluid_ViewHelpers_Form_ErrorsViewHelper();
44 $this->injectDependenciesIntoViewHelper($viewHelper);
45
46 $variableContainer = new Tx_Fluid_Core_ViewHelper_TemplateVariableContainer(array());
47 $viewHelperNode = new Tx_Fluid_ViewHelpers_Fixtures_ConstraintSyntaxTreeNode($variableContainer);
48 $viewHelper->setViewHelperNode($viewHelperNode);
49 $viewHelper->setTemplateVariableContainer($variableContainer);
50
51 $viewHelper->render();
52
53 $expectedCallProtocol = array(
54 array('error' => $mockError1),
55 array('error' => $mockError2)
56 );
57 $this->assertEquals($expectedCallProtocol, $viewHelperNode->callProtocol, 'The call protocol differs');
58 }
59
60 /**
61 * @test
62 * @author Christopher Hlubek <hlubek@networkteam.com>
63 */
64 public function renderWithForSpecifiedTriesToGetSpecificPropertyError() {
65 $this->markTestIncomplete('Not yet implemented');
66 }
67 }
68 ?>