File tree Expand file tree Collapse file tree
samples/client/petstore/php/OpenAPIClient-php/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,6 +149,30 @@ public function providerFlatten(): iterable
149149 ];
150150 }
151151
152+ public function testNullValueIgnored (): void
153+ {
154+ $ data = [
155+ 'id ' => '1234 ' ,
156+ 'name ' => 'Spike ' ,
157+ 'photo_urls ' => null ,
158+ 'status ' => null ,
159+ 'category ' => null ,
160+ 'tags ' => null ,
161+ ];
162+
163+ $ expected = [
164+ 'id ' => $ data ['id ' ],
165+ 'name ' => $ data ['name ' ],
166+ ];
167+
168+ $ formDataProcessor = new FormDataProcessor ();
169+ $ formData = $ formDataProcessor ->prepare ($ data );
170+
171+ $ result = $ formDataProcessor ::flatten ($ formData );
172+
173+ $ this ->assertEquals ($ expected , $ result );
174+ }
175+
152176 public function testHasFile (): void
153177 {
154178 $ filepath = realpath (__DIR__ . '/../.openapi-generator/VERSION ' );
You can’t perform that action at this time.
0 commit comments