2 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\ViewHelper;
26 $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\AbstractTagBasedViewHelper::class, array(
'dummy'), array(),
'',
false);
34 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'reset'), array(),
'',
false);
35 $mockTagBuilder->expects($this->once())->method(
'reset');
36 $this->viewHelper->_set(
'tag', $mockTagBuilder);
38 $this->viewHelper->initialize();
46 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'addAttribute'), array(),
'',
false);
47 $mockTagBuilder->expects($this->once())->method(
'addAttribute')->with(
'foo',
'bar');
48 $this->viewHelper->_set(
'tag', $mockTagBuilder);
50 $this->viewHelper->_call(
'registerTagAttribute',
'foo',
'string',
'Description',
false);
51 $arguments = array(
'foo' =>
'bar');
52 $this->viewHelper->setArguments($arguments);
53 $this->viewHelper->initialize();
61 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'addAttribute'), array(),
'',
false);
62 $mockTagBuilder->expects($this->once())->method(
'addAttribute')->with(
'foo',
'bar');
63 $this->viewHelper->_set(
'tag', $mockTagBuilder);
65 $this->viewHelper->_call(
'registerTagAttribute',
'foo',
'string',
'Description',
false);
66 $arguments = array(
'additionalAttributes' => array(
'foo' =>
'bar'));
67 $this->viewHelper->setArguments($arguments);
68 $this->viewHelper->initialize();
76 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'addAttribute'), array(),
'',
false);
77 $mockTagBuilder->expects($this->at(0))->method(
'addAttribute')->with(
'data-foo',
'bar');
78 $mockTagBuilder->expects($this->at(1))->method(
'addAttribute')->with(
'data-baz',
'foos');
79 $this->viewHelper->_set(
'tag', $mockTagBuilder);
81 $arguments = array(
'data' => array(
'foo' =>
'bar',
'baz' =>
'foos'));
82 $this->viewHelper->setArguments($arguments);
83 $this->viewHelper->initializeArguments();
84 $this->viewHelper->initialize();
92 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'addAttribute'), array(),
'',
false);
93 $mockTagBuilder->expects($this->at(0))->method(
'addAttribute')->with(
'class',
'classAttribute');
94 $mockTagBuilder->expects($this->at(1))->method(
'addAttribute')->with(
'dir',
'dirAttribute');
95 $mockTagBuilder->expects($this->at(2))->method(
'addAttribute')->with(
'id',
'idAttribute');
96 $mockTagBuilder->expects($this->at(3))->method(
'addAttribute')->with(
'lang',
'langAttribute');
97 $mockTagBuilder->expects($this->at(4))->method(
'addAttribute')->with(
'style',
'styleAttribute');
98 $mockTagBuilder->expects($this->at(5))->method(
'addAttribute')->with(
'title',
'titleAttribute');
99 $mockTagBuilder->expects($this->at(6))->method(
'addAttribute')->with(
'accesskey',
'accesskeyAttribute');
100 $mockTagBuilder->expects($this->at(7))->method(
'addAttribute')->with(
'tabindex',
'tabindexAttribute');
101 $this->viewHelper->_set(
'tag', $mockTagBuilder);
104 'class' =>
'classAttribute',
105 'dir' =>
'dirAttribute',
106 'id' =>
'idAttribute',
107 'lang' =>
'langAttribute',
108 'style' =>
'styleAttribute',
109 'title' =>
'titleAttribute',
110 'accesskey' =>
'accesskeyAttribute',
111 'tabindex' =>
'tabindexAttribute'
113 $this->viewHelper->_call(
'registerUniversalTagAttributes');
114 $this->viewHelper->setArguments($arguments);
115 $this->viewHelper->initializeArguments();
116 $this->viewHelper->initialize();
124 $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\AbstractTagBasedViewHelper::class, array(
'registerArgument'), array(),
'',
false);
125 $this->viewHelper->expects($this->once())->method(
'registerArgument')->with(
'foo',
'string',
'Description',
false,
'defaultValue');
126 $this->viewHelper->_call(
'registerTagAttribute',
'foo',
'string',
'Description',
false,
'defaultValue');
134 $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\AbstractTagBasedViewHelper::class, array(
'registerArgument'), array(),
'',
false);
135 $this->viewHelper->expects($this->once())->method(
'registerArgument')->with(
'foo',
'string',
'Description',
false, null);
136 $this->viewHelper->_call(
'registerTagAttribute',
'foo',
'string',
'Description',
false);