Skip to content

Commit df4daa6

Browse files
committed
One last test
1 parent c98db05 commit df4daa6

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

samples/client/petstore/php/OpenAPIClient-php/tests/FormDataProcessorTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)