/** * @test */ public function renderCorrectlySetsTagNameAndDefaultAttributes() { $mockTagBuilder = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute')); $mockTagBuilder->expects($this->once())->method('setTagName')->with('input'); $mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'hidden'); $mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo'); $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('foo'); $mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('value', 'bar'); $this->viewHelper->expects($this->once())->method('getName')->will($this->returnValue('foo')); $this->viewHelper->expects($this->once())->method('getValueAttribute')->will($this->returnValue('bar')); $this->viewHelper->_set('tag', $mockTagBuilder); $this->viewHelper->initialize(); $this->viewHelper->render(); }