2 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
29 $this->viewHelper = $this->getAccessibleMock(HiddenViewHelper::class, array(
'setErrorClassAttribute',
'getName',
'getValueAttribute',
'registerFieldNameForFormTokenGeneration'));
31 $this->viewHelper->initializeArguments();
39 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'setTagName',
'addAttribute'));
40 $mockTagBuilder->expects($this->once())->method(
'setTagName')->with(
'input');
41 $mockTagBuilder->expects($this->at(1))->method(
'addAttribute')->with(
'type',
'hidden');
42 $mockTagBuilder->expects($this->at(2))->method(
'addAttribute')->with(
'name',
'foo');
43 $this->viewHelper->expects($this->once())->method(
'registerFieldNameForFormTokenGeneration')->with(
'foo');
44 $mockTagBuilder->expects($this->at(3))->method(
'addAttribute')->with(
'value',
'bar');
46 $this->viewHelper->expects($this->once())->method(
'getName')->will($this->returnValue(
'foo'));
47 $this->viewHelper->expects($this->once())->method(
'getValueAttribute')->will($this->returnValue(
'bar'));
48 $this->viewHelper->_set(
'tag', $mockTagBuilder);
50 $this->viewHelper->initialize();
51 $this->viewHelper->render();