26 $this->viewHelper = $this->getMock(
'TYPO3\\CMS\\Fluid\\ViewHelpers\\CycleViewHelper', array(
'renderChildren'));
28 $this->viewHelper->initializeArguments();
35 $this->templateVariableContainer->expects($this->at(0))->method(
'add')->with(
'innerVariable',
'bar');
36 $this->templateVariableContainer->expects($this->at(1))->method(
'remove')->with(
'innerVariable');
38 $values = array(
'bar',
'Fluid');
39 $this->viewHelper->render($values,
'innerVariable');
46 $this->templateVariableContainer->expects($this->at(0))->method(
'add')->with(
'innerVariable',
'bar');
47 $this->templateVariableContainer->expects($this->at(1))->method(
'remove')->with(
'innerVariable');
48 $this->templateVariableContainer->expects($this->at(2))->method(
'add')->with(
'innerVariable',
'Fluid');
49 $this->templateVariableContainer->expects($this->at(3))->method(
'remove')->with(
'innerVariable');
50 $this->templateVariableContainer->expects($this->at(4))->method(
'add')->with(
'innerVariable',
'bar');
51 $this->templateVariableContainer->expects($this->at(5))->method(
'remove')->with(
'innerVariable');
53 $values = array(
'bar',
'Fluid');
54 $this->viewHelper->render($values,
'innerVariable');
55 $this->viewHelper->render($values,
'innerVariable');
56 $this->viewHelper->render($values,
'innerVariable');
63 $this->templateVariableContainer->expects($this->at(0))->method(
'add')->with(
'innerVariable',
'FLOW3');
64 $this->templateVariableContainer->expects($this->at(1))->method(
'remove')->with(
'innerVariable');
65 $this->templateVariableContainer->expects($this->at(2))->method(
'add')->with(
'innerVariable',
'Fluid');
66 $this->templateVariableContainer->expects($this->at(3))->method(
'remove')->with(
'innerVariable');
67 $this->templateVariableContainer->expects($this->at(4))->method(
'add')->with(
'innerVariable',
'FLOW3');
68 $this->templateVariableContainer->expects($this->at(5))->method(
'remove')->with(
'innerVariable');
70 $values = array(
'foo' =>
'FLOW3',
'bar' =>
'Fluid');
71 $this->viewHelper->render($values,
'innerVariable');
72 $this->viewHelper->render($values,
'innerVariable');
73 $this->viewHelper->render($values,
'innerVariable');
81 $object = new \stdClass();
83 $this->viewHelper->render($object,
'innerVariable');
90 $this->viewHelper->expects($this->once())->method(
'renderChildren')->will($this->returnValue(
'Child nodes'));
92 $this->assertEquals(
'Child nodes', $this->viewHelper->render(NULL,
'foo'));
99 $this->templateVariableContainer->expects($this->at(0))->method(
'add')->with(
'foo', NULL);
100 $this->templateVariableContainer->expects($this->at(1))->method(
'remove')->with(
'foo');
102 $this->viewHelper->expects($this->once())->method(
'renderChildren')->will($this->returnValue(
'Child nodes'));
104 $this->assertEquals(
'Child nodes', $this->viewHelper->render(array(),
'foo'));
111 $this->templateVariableContainer->expects($this->at(0))->method(
'add')->with(
'innerVariable',
'value1');
112 $this->templateVariableContainer->expects($this->at(1))->method(
'remove')->with(
'innerVariable');
113 $this->templateVariableContainer->expects($this->at(2))->method(
'add')->with(
'innerVariable',
'value2');
114 $this->templateVariableContainer->expects($this->at(3))->method(
'remove')->with(
'innerVariable');
115 $this->templateVariableContainer->expects($this->at(4))->method(
'add')->with(
'innerVariable',
'value1');
116 $this->templateVariableContainer->expects($this->at(5))->method(
'remove')->with(
'innerVariable');
118 $traversableObject = new \ArrayObject(array(
'key1' =>
'value1',
'key2' =>
'value2'));
119 $this->viewHelper->render($traversableObject,
'innerVariable');
120 $this->viewHelper->render($traversableObject,
'innerVariable');
121 $this->viewHelper->render($traversableObject,
'innerVariable');
renderAddsCurrentValueToTemplateVariableContainerAndRemovesItAfterRendering()
injectDependenciesIntoViewHelper(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper)
renderIteratesThroughElementsOfTraversableObjects()
renderThrowsExceptionWhenPassingObjectsToValuesThatAreNotTraversable()
renderAddsFirstValueToTemplateVariableContainerAfterLastValue()
renderReturnsChildNodesIfValuesIsAnEmptyArray()
viewHelperSupportsAssociativeArrays()
renderReturnsChildNodesIfValuesIsNull()