17
17
use Symfony \Component \Form \Extension \Core \Type \CheckboxType ;
18
18
use Symfony \Component \Form \Extension \Core \Type \CollectionType ;
19
19
use Symfony \Component \Form \Extension \Core \Type \FormType ;
20
- use Symfony \Component \Form \Extension \Core \Type \TextType ;
21
20
use Symfony \Component \Form \Form ;
22
21
use Symfony \Component \Form \FormBuilder ;
23
- use Symfony \Component \Form \FormConfigBuilder ;
24
22
use Symfony \Component \Form \FormError ;
25
23
use Symfony \Component \Form \FormFactory ;
26
24
use Symfony \Component \Form \FormFactoryInterface ;
27
25
use Symfony \Component \Form \Forms ;
28
26
use Symfony \Component \Form \RequestHandlerInterface ;
29
- use Symfony \Component \Form \ResolvedFormType ;
30
27
use Symfony \Component \Form \Util \ServerParams ;
31
28
32
29
/**
@@ -77,7 +74,7 @@ public function testSubmitCheckboxInCollectionFormWithEmptyData($method)
77
74
{
78
75
$ form = $ this ->factory ->create (CollectionType::class, [true , false , true ], [
79
76
'entry_type ' => CheckboxType::class,
80
- 'method ' => $ method
77
+ 'method ' => $ method,
81
78
]);
82
79
83
80
$ this ->setRequestData ($ method , [
@@ -95,13 +92,13 @@ public function testSubmitCheckboxInCollectionFormWithPartialData($method)
95
92
{
96
93
$ form = $ this ->factory ->create (CollectionType::class, [true , false , true ], [
97
94
'entry_type ' => CheckboxType::class,
98
- 'method ' => $ method
95
+ 'method ' => $ method,
99
96
]);
100
97
101
98
$ this ->setRequestData ($ method , [
102
99
'collection ' => [
103
- 1 => true
104
- ]
100
+ 1 => true ,
101
+ ],
105
102
]);
106
103
107
104
$ this ->requestHandler ->handleRequest ($ form , $ this ->request );
@@ -115,10 +112,10 @@ public function testSubmitCheckboxInCollectionFormWithPartialData($method)
115
112
public function testSubmitCheckboxFormWithEmptyData ($ method )
116
113
{
117
114
$ form = $ this ->factory ->create (FormType::class, ['subform ' => ['checkbox ' => true ]], [
118
- 'method ' => $ method
115
+ 'method ' => $ method,
119
116
])
120
117
->add ('subform ' , FormType::class, [
121
- 'compound ' => true
118
+ 'compound ' => true ,
122
119
]);
123
120
124
121
$ form ->get ('subform ' )
@@ -137,7 +134,7 @@ public function testSubmitCheckboxFormWithEmptyData($method)
137
134
public function testSubmitSimpleCheckboxFormWithEmptyData ($ method )
138
135
{
139
136
$ form = $ this ->factory ->createNamed ('checkbox ' , CheckboxType::class, true , [
140
- 'method ' => $ method
137
+ 'method ' => $ method,
141
138
]);
142
139
143
140
$ this ->setRequestData ($ method , []);
@@ -476,14 +473,14 @@ public function testFailedFileUploadIsTurnedIntoFormError($errorCode, $expectedE
476
473
public function uploadFileErrorCodes ()
477
474
{
478
475
return [
479
- 'no error ' => [\UPLOAD_ERR_OK , null ],
476
+ 'no error ' => [\UPLOAD_ERR_OK , null ],
480
477
'upload_max_filesize ini directive ' => [\UPLOAD_ERR_INI_SIZE , \UPLOAD_ERR_INI_SIZE ],
481
- 'MAX_FILE_SIZE from form ' => [\UPLOAD_ERR_FORM_SIZE , \UPLOAD_ERR_FORM_SIZE ],
482
- 'partially uploaded ' => [\UPLOAD_ERR_PARTIAL , \UPLOAD_ERR_PARTIAL ],
483
- 'no file upload ' => [\UPLOAD_ERR_NO_FILE , \UPLOAD_ERR_NO_FILE ],
484
- 'missing temporary directory ' => [\UPLOAD_ERR_NO_TMP_DIR , \UPLOAD_ERR_NO_TMP_DIR ],
485
- 'write failure ' => [\UPLOAD_ERR_CANT_WRITE , \UPLOAD_ERR_CANT_WRITE ],
486
- 'stopped by extension ' => [\UPLOAD_ERR_EXTENSION , \UPLOAD_ERR_EXTENSION ],
478
+ 'MAX_FILE_SIZE from form ' => [\UPLOAD_ERR_FORM_SIZE , \UPLOAD_ERR_FORM_SIZE ],
479
+ 'partially uploaded ' => [\UPLOAD_ERR_PARTIAL , \UPLOAD_ERR_PARTIAL ],
480
+ 'no file upload ' => [\UPLOAD_ERR_NO_FILE , \UPLOAD_ERR_NO_FILE ],
481
+ 'missing temporary directory ' => [\UPLOAD_ERR_NO_TMP_DIR , \UPLOAD_ERR_NO_TMP_DIR ],
482
+ 'write failure ' => [\UPLOAD_ERR_CANT_WRITE , \UPLOAD_ERR_CANT_WRITE ],
483
+ 'stopped by extension ' => [\UPLOAD_ERR_EXTENSION , \UPLOAD_ERR_EXTENSION ],
487
484
];
488
485
}
489
486
0 commit comments