26 $this->viewHelper = $this->
getAccessibleMock(
'TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\RadioViewHelper', array(
'setErrorClassAttribute',
'getName',
'getValue',
'isObjectAccessorMode',
'getPropertyValue',
'registerFieldNameForFormTokenGeneration'));
28 $this->viewHelper->initializeArguments();
35 $mockTagBuilder = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array(
'setTagName',
'addAttribute'));
36 $mockTagBuilder->expects($this->once())->method(
'setTagName')->with(
'input');
37 $mockTagBuilder->expects($this->at(1))->method(
'addAttribute')->with(
'type',
'radio');
38 $mockTagBuilder->expects($this->at(2))->method(
'addAttribute')->with(
'name',
'foo');
39 $this->viewHelper->expects($this->once())->method(
'registerFieldNameForFormTokenGeneration')->with(
'foo');
40 $mockTagBuilder->expects($this->at(3))->method(
'addAttribute')->with(
'value',
'bar');
42 $this->viewHelper->expects($this->any())->method(
'getName')->will($this->returnValue(
'foo'));
43 $this->viewHelper->expects($this->any())->method(
'getValue')->will($this->returnValue(
'bar'));
44 $this->viewHelper->_set(
'tag', $mockTagBuilder);
46 $this->viewHelper->initialize();
47 $this->viewHelper->render();
54 $mockTagBuilder = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array(
'setTagName',
'addAttribute'));
55 $mockTagBuilder->expects($this->at(1))->method(
'addAttribute')->with(
'type',
'radio');
56 $mockTagBuilder->expects($this->at(2))->method(
'addAttribute')->with(
'name',
'foo');
57 $this->viewHelper->expects($this->once())->method(
'registerFieldNameForFormTokenGeneration')->with(
'foo');
58 $mockTagBuilder->expects($this->at(3))->method(
'addAttribute')->with(
'value',
'bar');
59 $mockTagBuilder->expects($this->at(4))->method(
'addAttribute')->with(
'checked',
'checked');
61 $this->viewHelper->expects($this->any())->method(
'getName')->will($this->returnValue(
'foo'));
62 $this->viewHelper->expects($this->any())->method(
'getValue')->will($this->returnValue(
'bar'));
63 $this->viewHelper->_set(
'tag', $mockTagBuilder);
65 $this->viewHelper->initialize();
66 $this->viewHelper->render(TRUE);
73 $mockTagBuilder = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array(
'setTagName',
'addAttribute'));
74 $mockTagBuilder->expects($this->at(1))->method(
'addAttribute')->with(
'type',
'radio');
75 $mockTagBuilder->expects($this->at(2))->method(
'addAttribute')->with(
'name',
'foo');
76 $mockTagBuilder->expects($this->at(3))->method(
'addAttribute')->with(
'value',
'bar');
78 $this->viewHelper->expects($this->any())->method(
'getName')->will($this->returnValue(
'foo'));
79 $this->viewHelper->expects($this->any())->method(
'getValue')->will($this->returnValue(
'bar'));
80 $this->viewHelper->expects($this->never())->method(
'isObjectAccessorMode')->will($this->returnValue(TRUE));
81 $this->viewHelper->expects($this->never())->method(
'getPropertyValue')->will($this->returnValue(TRUE));
82 $this->viewHelper->_set(
'tag', $mockTagBuilder);
84 $this->viewHelper->initialize();
85 $this->viewHelper->render(TRUE);
86 $this->viewHelper->render(FALSE);
93 $mockTagBuilder = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array(
'setTagName',
'addAttribute'));
94 $mockTagBuilder->expects($this->at(1))->method(
'addAttribute')->with(
'type',
'radio');
95 $mockTagBuilder->expects($this->at(2))->method(
'addAttribute')->with(
'name',
'foo');
96 $this->viewHelper->expects($this->once())->method(
'registerFieldNameForFormTokenGeneration')->with(
'foo');
97 $mockTagBuilder->expects($this->at(3))->method(
'addAttribute')->with(
'value',
'bar');
98 $mockTagBuilder->expects($this->at(4))->method(
'addAttribute')->with(
'checked',
'checked');
100 $this->viewHelper->expects($this->any())->method(
'getName')->will($this->returnValue(
'foo'));
101 $this->viewHelper->expects($this->any())->method(
'getValue')->will($this->returnValue(
'bar'));
102 $this->viewHelper->expects($this->any())->method(
'isObjectAccessorMode')->will($this->returnValue(TRUE));
103 $this->viewHelper->expects($this->any())->method(
'getPropertyValue')->will($this->returnValue(TRUE));
104 $this->viewHelper->_set(
'tag', $mockTagBuilder);
106 $this->viewHelper->initialize();
107 $this->viewHelper->render();
114 $mockTagBuilder = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array(
'setTagName',
'addAttribute'));
115 $mockTagBuilder->expects($this->at(1))->method(
'addAttribute')->with(
'type',
'radio');
116 $mockTagBuilder->expects($this->at(2))->method(
'addAttribute')->with(
'name',
'foo');
117 $this->viewHelper->expects($this->once())->method(
'registerFieldNameForFormTokenGeneration')->with(
'foo');
118 $mockTagBuilder->expects($this->at(3))->method(
'addAttribute')->with(
'value',
'bar');
120 $this->viewHelper->expects($this->any())->method(
'getName')->will($this->returnValue(
'foo'));
121 $this->viewHelper->expects($this->any())->method(
'getValue')->will($this->returnValue(
'bar'));
122 $this->viewHelper->expects($this->any())->method(
'isObjectAccessorMode')->will($this->returnValue(TRUE));
123 $this->viewHelper->expects($this->any())->method(
'getPropertyValue')->will($this->returnValue(array()));
124 $this->viewHelper->_set(
'tag', $mockTagBuilder);
126 $this->viewHelper->initialize();
127 $this->viewHelper->render();
134 $mockTagBuilder = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array(
'setTagName',
'addAttribute'));
135 $mockTagBuilder->expects($this->at(1))->method(
'addAttribute')->with(
'type',
'radio');
136 $mockTagBuilder->expects($this->at(2))->method(
'addAttribute')->with(
'name',
'foo');
137 $this->viewHelper->expects($this->once())->method(
'registerFieldNameForFormTokenGeneration')->with(
'foo');
138 $mockTagBuilder->expects($this->at(3))->method(
'addAttribute')->with(
'value',
'bar');
139 $mockTagBuilder->expects($this->at(4))->method(
'addAttribute')->with(
'checked',
'checked');
141 $this->viewHelper->expects($this->any())->method(
'getName')->will($this->returnValue(
'foo'));
142 $this->viewHelper->expects($this->any())->method(
'getValue')->will($this->returnValue(
'bar'));
143 $this->viewHelper->expects($this->any())->method(
'isObjectAccessorMode')->will($this->returnValue(TRUE));
144 $this->viewHelper->expects($this->any())->method(
'getPropertyValue')->will($this->returnValue(
'bar'));
145 $this->viewHelper->_set(
'tag', $mockTagBuilder);
147 $this->viewHelper->initialize();
148 $this->viewHelper->render();
155 $this->viewHelper->expects($this->once())->method(
'setErrorClassAttribute');
156 $this->viewHelper->render();
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)