File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,25 @@ public function testFormData():void {
180
180
self ::assertSame ("orange " , $ actualFormData ->getString ("colour " ));
181
181
}
182
182
183
+ public function testAwaitFormData ():void {
184
+ $ data = [
185
+ "name " => "Cody " ,
186
+ "colour " => "orange " ,
187
+ ];
188
+
189
+ $ stream = new Stream ();
190
+ $ stream ->write (http_build_query ($ data ));
191
+
192
+ $ sut = new Response ();
193
+ $ sut = $ sut ->withHeader ("Content-type " , "application/x-www-form-urlencoded " );
194
+ $ sut = $ sut ->withBody ($ stream );
195
+
196
+ $ formData = $ sut ->awaitFormData ();
197
+ self ::assertInstanceOf (FormData::class, $ formData );
198
+ self ::assertSame ("Cody " , $ formData ->getString ("name " ));
199
+ self ::assertSame ("orange " , $ formData ->getString ("colour " ));
200
+ }
201
+
183
202
public function testRedirect_sendsFileLineDebug ():void {
184
203
$ sut = (new Response ());
185
204
$ sut ->redirect ("/somewhere " );
You can’t perform that action at this time.
0 commit comments