@@ -20,7 +20,7 @@ class CollectionTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
20
20
public function testContainsNoChildByDefault ()
21
21
{
22
22
$ form = $ this ->factory ->create ('collection ' , null , array (
23
- 'type ' => 'text ' ,
23
+ 'entry_type ' => 'text ' ,
24
24
));
25
25
26
26
$ this ->assertCount (0 , $ form );
@@ -29,8 +29,8 @@ public function testContainsNoChildByDefault()
29
29
public function testSetDataAdjustsSize ()
30
30
{
31
31
$ form = $ this ->factory ->create ('collection ' , null , array (
32
- 'type ' => 'text ' ,
33
- 'options ' => array (
32
+ 'entry_type ' => 'text ' ,
33
+ 'entry_options ' => array (
34
34
'attr ' => array ('maxlength ' => 20 ),
35
35
),
36
36
));
@@ -58,7 +58,7 @@ public function testSetDataAdjustsSize()
58
58
public function testThrowsExceptionIfObjectIsNotTraversable ()
59
59
{
60
60
$ form = $ this ->factory ->create ('collection ' , null , array (
61
- 'type ' => 'text ' ,
61
+ 'entry_type ' => 'text ' ,
62
62
));
63
63
$ this ->setExpectedException ('Symfony\Component\Form\Exception\UnexpectedTypeException ' );
64
64
$ form ->setData (new \stdClass ());
@@ -67,7 +67,7 @@ public function testThrowsExceptionIfObjectIsNotTraversable()
67
67
public function testNotResizedIfSubmittedWithMissingData ()
68
68
{
69
69
$ form = $ this ->factory ->create ('collection ' , null , array (
70
- 'type ' => 'text ' ,
70
+ 'entry_type ' => 'text ' ,
71
71
));
72
72
$ form ->setData (array ('foo@foo.com ' , 'bar@bar.com ' ));
73
73
$ form ->submit (array ('foo@bar.com ' ));
@@ -81,7 +81,7 @@ public function testNotResizedIfSubmittedWithMissingData()
81
81
public function testResizedDownIfSubmittedWithMissingDataAndAllowDelete ()
82
82
{
83
83
$ form = $ this ->factory ->create ('collection ' , null , array (
84
- 'type ' => 'text ' ,
84
+ 'entry_type ' => 'text ' ,
85
85
'allow_delete ' => true ,
86
86
));
87
87
$ form ->setData (array ('foo@foo.com ' , 'bar@bar.com ' ));
@@ -96,7 +96,7 @@ public function testResizedDownIfSubmittedWithMissingDataAndAllowDelete()
96
96
public function testResizedDownIfSubmittedWithEmptyDataAndDeleteEmpty ()
97
97
{
98
98
$ form = $ this ->factory ->create ('collection ' , null , array (
99
- 'type ' => 'text ' ,
99
+ 'entry_type ' => 'text ' ,
100
100
'allow_delete ' => true ,
101
101
'delete_empty ' => true ,
102
102
));
@@ -113,7 +113,7 @@ public function testResizedDownIfSubmittedWithEmptyDataAndDeleteEmpty()
113
113
public function testDontAddEmptyDataIfDeleteEmpty ()
114
114
{
115
115
$ form = $ this ->factory ->create ('collection ' , null , array (
116
- 'type ' => 'text ' ,
116
+ 'entry_type ' => 'text ' ,
117
117
'allow_add ' => true ,
118
118
'delete_empty ' => true ,
119
119
));
@@ -130,7 +130,7 @@ public function testDontAddEmptyDataIfDeleteEmpty()
130
130
public function testNoDeleteEmptyIfDeleteNotAllowed ()
131
131
{
132
132
$ form = $ this ->factory ->create ('collection ' , null , array (
133
- 'type ' => 'text ' ,
133
+ 'entry_type ' => 'text ' ,
134
134
'allow_delete ' => false ,
135
135
'delete_empty ' => true ,
136
136
));
@@ -145,10 +145,10 @@ public function testNoDeleteEmptyIfDeleteNotAllowed()
145
145
public function testResizedDownIfSubmittedWithCompoundEmptyDataAndDeleteEmpty ()
146
146
{
147
147
$ form = $ this ->factory ->create ('collection ' , null , array (
148
- 'type ' => new AuthorType (),
148
+ 'entry_type ' => new AuthorType (),
149
149
// If the field is not required, no new Author will be created if the
150
150
// form is completely empty
151
- 'options ' => array ('required ' => false ),
151
+ 'entry_options ' => array ('required ' => false ),
152
152
'allow_add ' => true ,
153
153
'delete_empty ' => true ,
154
154
));
@@ -168,7 +168,7 @@ public function testResizedDownIfSubmittedWithCompoundEmptyDataAndDeleteEmpty()
168
168
public function testNotResizedIfSubmittedWithExtraData ()
169
169
{
170
170
$ form = $ this ->factory ->create ('collection ' , null , array (
171
- 'type ' => 'text ' ,
171
+ 'entry_type ' => 'text ' ,
172
172
));
173
173
$ form ->setData (array ('foo@bar.com ' ));
174
174
$ form ->submit (array ('foo@foo.com ' , 'bar@bar.com ' ));
@@ -181,7 +181,7 @@ public function testNotResizedIfSubmittedWithExtraData()
181
181
public function testResizedUpIfSubmittedWithExtraDataAndAllowAdd ()
182
182
{
183
183
$ form = $ this ->factory ->create ('collection ' , null , array (
184
- 'type ' => 'text ' ,
184
+ 'entry_type ' => 'text ' ,
185
185
'allow_add ' => true ,
186
186
));
187
187
$ form ->setData (array ('foo@bar.com ' ));
@@ -197,7 +197,7 @@ public function testResizedUpIfSubmittedWithExtraDataAndAllowAdd()
197
197
public function testAllowAddButNoPrototype ()
198
198
{
199
199
$ form = $ this ->factory ->create ('collection ' , null , array (
200
- 'type ' => 'form ' ,
200
+ 'entry_type ' => 'form ' ,
201
201
'allow_add ' => true ,
202
202
'prototype ' => false ,
203
203
));
@@ -209,7 +209,7 @@ public function testPrototypeMultipartPropagation()
209
209
{
210
210
$ form = $ this ->factory
211
211
->create ('collection ' , null , array (
212
- 'type ' => 'file ' ,
212
+ 'entry_type ' => 'file ' ,
213
213
'allow_add ' => true ,
214
214
'prototype ' => true ,
215
215
))
@@ -221,7 +221,7 @@ public function testPrototypeMultipartPropagation()
221
221
public function testGetDataDoesNotContainsPrototypeNameBeforeDataAreSet ()
222
222
{
223
223
$ form = $ this ->factory ->create ('collection ' , array (), array (
224
- 'type ' => 'file ' ,
224
+ 'entry_type ' => 'file ' ,
225
225
'prototype ' => true ,
226
226
'allow_add ' => true ,
227
227
));
@@ -233,7 +233,7 @@ public function testGetDataDoesNotContainsPrototypeNameBeforeDataAreSet()
233
233
public function testGetDataDoesNotContainsPrototypeNameAfterDataAreSet ()
234
234
{
235
235
$ form = $ this ->factory ->create ('collection ' , array (), array (
236
- 'type ' => 'file ' ,
236
+ 'entry_type ' => 'file ' ,
237
237
'allow_add ' => true ,
238
238
'prototype ' => true ,
239
239
));
@@ -246,15 +246,15 @@ public function testGetDataDoesNotContainsPrototypeNameAfterDataAreSet()
246
246
public function testPrototypeNameOption ()
247
247
{
248
248
$ form = $ this ->factory ->create ('collection ' , null , array (
249
- 'type ' => 'form ' ,
249
+ 'entry_type ' => 'form ' ,
250
250
'prototype ' => true ,
251
251
'allow_add ' => true ,
252
252
));
253
253
254
254
$ this ->assertSame ('__name__ ' , $ form ->getConfig ()->getAttribute ('prototype ' )->getName (), '__name__ is the default ' );
255
255
256
256
$ form = $ this ->factory ->create ('collection ' , null , array (
257
- 'type ' => 'form ' ,
257
+ 'entry_type ' => 'form ' ,
258
258
'prototype ' => true ,
259
259
'allow_add ' => true ,
260
260
'prototype_name ' => '__test__ ' ,
@@ -266,7 +266,7 @@ public function testPrototypeNameOption()
266
266
public function testPrototypeDefaultLabel ()
267
267
{
268
268
$ form = $ this ->factory ->create ('collection ' , array (), array (
269
- 'type ' => 'file ' ,
269
+ 'entry_type ' => 'file ' ,
270
270
'allow_add ' => true ,
271
271
'prototype ' => true ,
272
272
'prototype_name ' => '__test__ ' ,
0 commit comments