2 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
27 $this->viewHelper = $this->getMock(\TYPO3\CMS\
Fluid\ViewHelpers\CycleViewHelper::class, array(
'renderChildren'));
29 $this->viewHelper->initializeArguments();
37 $this->templateVariableContainer->expects($this->at(0))->method(
'add')->with(
'innerVariable',
'bar');
38 $this->templateVariableContainer->expects($this->at(1))->method(
'remove')->with(
'innerVariable');
40 $values = array(
'bar',
'Fluid');
41 $this->viewHelper->render($values,
'innerVariable');
49 $this->templateVariableContainer->expects($this->at(0))->method(
'add')->with(
'innerVariable',
'bar');
50 $this->templateVariableContainer->expects($this->at(1))->method(
'remove')->with(
'innerVariable');
51 $this->templateVariableContainer->expects($this->at(2))->method(
'add')->with(
'innerVariable',
'Fluid');
52 $this->templateVariableContainer->expects($this->at(3))->method(
'remove')->with(
'innerVariable');
53 $this->templateVariableContainer->expects($this->at(4))->method(
'add')->with(
'innerVariable',
'bar');
54 $this->templateVariableContainer->expects($this->at(5))->method(
'remove')->with(
'innerVariable');
56 $values = array(
'bar',
'Fluid');
57 $this->viewHelper->render($values,
'innerVariable');
58 $this->viewHelper->render($values,
'innerVariable');
59 $this->viewHelper->render($values,
'innerVariable');
67 $this->templateVariableContainer->expects($this->at(0))->method(
'add')->with(
'innerVariable',
'FLOW3');
68 $this->templateVariableContainer->expects($this->at(1))->method(
'remove')->with(
'innerVariable');
69 $this->templateVariableContainer->expects($this->at(2))->method(
'add')->with(
'innerVariable',
'Fluid');
70 $this->templateVariableContainer->expects($this->at(3))->method(
'remove')->with(
'innerVariable');
71 $this->templateVariableContainer->expects($this->at(4))->method(
'add')->with(
'innerVariable',
'FLOW3');
72 $this->templateVariableContainer->expects($this->at(5))->method(
'remove')->with(
'innerVariable');
74 $values = array(
'foo' =>
'FLOW3',
'bar' =>
'Fluid');
75 $this->viewHelper->render($values,
'innerVariable');
76 $this->viewHelper->render($values,
'innerVariable');
77 $this->viewHelper->render($values,
'innerVariable');
86 $object = new \stdClass();
88 $this->viewHelper->render($object,
'innerVariable');
96 $this->viewHelper->expects($this->once())->method(
'renderChildren')->will($this->returnValue(
'Child nodes'));
98 $this->assertEquals(
'Child nodes', $this->viewHelper->render(null,
'foo'));
106 $this->templateVariableContainer->expects($this->at(0))->method(
'add')->with(
'foo', null);
107 $this->templateVariableContainer->expects($this->at(1))->method(
'remove')->with(
'foo');
109 $this->viewHelper->expects($this->once())->method(
'renderChildren')->will($this->returnValue(
'Child nodes'));
111 $this->assertEquals(
'Child nodes', $this->viewHelper->render(array(),
'foo'));
119 $this->templateVariableContainer->expects($this->at(0))->method(
'add')->with(
'innerVariable',
'value1');
120 $this->templateVariableContainer->expects($this->at(1))->method(
'remove')->with(
'innerVariable');
121 $this->templateVariableContainer->expects($this->at(2))->method(
'add')->with(
'innerVariable',
'value2');
122 $this->templateVariableContainer->expects($this->at(3))->method(
'remove')->with(
'innerVariable');
123 $this->templateVariableContainer->expects($this->at(4))->method(
'add')->with(
'innerVariable',
'value1');
124 $this->templateVariableContainer->expects($this->at(5))->method(
'remove')->with(
'innerVariable');
126 $traversableObject = new \ArrayObject(array(
'key1' =>
'value1',
'key2' =>
'value2'));
127 $this->viewHelper->render($traversableObject,
'innerVariable');
128 $this->viewHelper->render($traversableObject,
'innerVariable');
129 $this->viewHelper->render($traversableObject,
'innerVariable');