16
16
17
17
use Cake \Collection \Collection ;
18
18
use Cake \TestSuite \TestCase ;
19
+ use Cake \View \Input \Label ;
19
20
use Cake \View \Input \Radio ;
20
21
use Cake \View \StringTemplate ;
21
22
@@ -45,7 +46,8 @@ public function setUp() {
45
46
* @return void
46
47
*/
47
48
public function testRenderSimple () {
48
- $ radio = new Radio ($ this ->templates );
49
+ $ label = new Label ($ this ->templates );
50
+ $ radio = new Radio ($ this ->templates , $ label );
49
51
$ data = [
50
52
'name ' => 'Crayons[color] ' ,
51
53
'options ' => ['r ' => 'Red ' , 'b ' => 'Black ' ]
@@ -87,7 +89,8 @@ public function testRenderSimple() {
87
89
* @return void
88
90
*/
89
91
public function testRenderComplex () {
90
- $ radio = new Radio ($ this ->templates );
92
+ $ label = new Label ($ this ->templates );
93
+ $ radio = new Radio ($ this ->templates , $ label );
91
94
$ data = [
92
95
'name ' => 'Crayons[color] ' ,
93
96
'options ' => [
@@ -126,7 +129,8 @@ public function testRenderComplex() {
126
129
* @return void
127
130
*/
128
131
public function testRenderEmptyOption () {
129
- $ radio = new Radio ($ this ->templates );
132
+ $ label = new Label ($ this ->templates );
133
+ $ radio = new Radio ($ this ->templates , $ label );
130
134
$ data = [
131
135
'name ' => 'Crayons[color] ' ,
132
136
'options ' => ['r ' => 'Red ' ],
@@ -190,7 +194,8 @@ public function testRenderInputInsideLabel() {
190
194
'label ' => '<label{{attrs}}>{{input}}{{text}}</label> ' ,
191
195
'radioContainer ' => '{{label}} ' ,
192
196
]);
193
- $ radio = new Radio ($ this ->templates );
197
+ $ label = new Label ($ this ->templates );
198
+ $ radio = new Radio ($ this ->templates , $ label );
194
199
$ data = [
195
200
'name ' => 'Crayons[color] ' ,
196
201
'options ' => ['r ' => 'Red ' ],
@@ -216,7 +221,8 @@ public function testRenderInputInsideLabel() {
216
221
* @return void
217
222
*/
218
223
public function testRenderSelected () {
219
- $ radio = new Radio ($ this ->templates );
224
+ $ label = new Label ($ this ->templates );
225
+ $ radio = new Radio ($ this ->templates , $ label );
220
226
$ data = [
221
227
'name ' => 'Versions[ver] ' ,
222
228
'val ' => '1 ' ,
@@ -266,7 +272,8 @@ public function testRenderSelected() {
266
272
* @return void
267
273
*/
268
274
public function testRenderDisabled () {
269
- $ radio = new Radio ($ this ->templates );
275
+ $ label = new Label ($ this ->templates );
276
+ $ radio = new Radio ($ this ->templates , $ label );
270
277
$ data = [
271
278
'name ' => 'Versions[ver] ' ,
272
279
'options ' => [
@@ -333,7 +340,8 @@ public function testRenderDisabled() {
333
340
* @return void
334
341
*/
335
342
public function testRenderLabelOptions () {
336
- $ radio = new Radio ($ this ->templates );
343
+ $ label = new Label ($ this ->templates );
344
+ $ radio = new Radio ($ this ->templates , $ label );
337
345
$ data = [
338
346
'name ' => 'Versions[ver] ' ,
339
347
'options ' => [
@@ -405,7 +413,8 @@ public function testRenderContainerTemplate() {
405
413
$ this ->templates ->add ([
406
414
'radioContainer ' => '<div class="radio">{{input}}{{label}}</div> '
407
415
]);
408
- $ radio = new Radio ($ this ->templates );
416
+ $ label = new Label ($ this ->templates );
417
+ $ radio = new Radio ($ this ->templates , $ label );
409
418
$ data = [
410
419
'name ' => 'Versions[ver] ' ,
411
420
'options ' => [
0 commit comments