/** * @test */ public function renderIteratesThroughElementsOfTraversableObjects() { $this->templateVariableContainer->expects($this->at(0))->method('add')->with('innerVariable', 'value1'); $this->templateVariableContainer->expects($this->at(1))->method('remove')->with('innerVariable'); $this->templateVariableContainer->expects($this->at(2))->method('add')->with('innerVariable', 'value2'); $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('innerVariable'); $this->templateVariableContainer->expects($this->at(4))->method('add')->with('innerVariable', 'value1'); $this->templateVariableContainer->expects($this->at(5))->method('remove')->with('innerVariable'); $traversableObject = new \ArrayObject(array('key1' => 'value1', 'key2' => 'value2')); $this->viewHelper->render($traversableObject, 'innerVariable'); $this->viewHelper->render($traversableObject, 'innerVariable'); $this->viewHelper->render($traversableObject, 'innerVariable'); }