2 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form;
27 $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\
Fluid\ViewHelpers\Form\ButtonViewHelper::class, array(
'renderChildren'));
28 $this->arguments[
'name'] =
'';
30 $this->viewHelper->initializeArguments();
38 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'setTagName',
'addAttribute',
'setContent'));
39 $mockTagBuilder->expects($this->once())->method(
'setTagName')->with(
'button');
40 $mockTagBuilder->expects($this->at(1))->method(
'addAttribute')->with(
'type',
'submit');
41 $mockTagBuilder->expects($this->at(2))->method(
'addAttribute')->with(
'name',
'');
42 $mockTagBuilder->expects($this->at(3))->method(
'addAttribute')->with(
'value',
'');
43 $mockTagBuilder->expects($this->at(4))->method(
'setContent')->with(
'Button Content');
45 $this->viewHelper->expects($this->atLeastOnce())->method(
'renderChildren')->will($this->returnValue(
'Button Content'));
47 $this->viewHelper->_set(
'tag', $mockTagBuilder);
49 $this->viewHelper->initialize();
50 $this->viewHelper->render();