Skip to content

Commit 3e63575

Browse files
author
abluchet
committed
Fix null title/description configuration (#1563 followup)
1 parent 81770d5 commit 3e63575

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,40 @@ public function testApiKeysConfig()
234234
$this->assertTrue(isset($config['swagger']['api_keys']));
235235
$this->assertSame($exampleConfig, $config['swagger']['api_keys'][0]);
236236
}
237+
238+
/**
239+
* Test config for empty title and description.
240+
*/
241+
public function testEmptyTitleDescriptionConfig()
242+
{
243+
$testConfig = [
244+
'title' => '',
245+
'description' => '',
246+
];
247+
248+
$config = $this->processor->processConfiguration($this->configuration, [
249+
'api_platform' => $testConfig,
250+
]);
251+
252+
$this->assertSame($config['title'], '');
253+
$this->assertSame($config['description'], '');
254+
}
255+
256+
/**
257+
* Test config for null title and description.
258+
*/
259+
public function testNullTitleDescriptionConfig()
260+
{
261+
$testConfig = [
262+
'title' => null,
263+
'description' => null,
264+
];
265+
266+
$config = $this->processor->processConfiguration($this->configuration, [
267+
'api_platform' => $testConfig,
268+
]);
269+
270+
$this->assertSame($config['title'], '');
271+
$this->assertSame($config['description'], '');
272+
}
237273
}

0 commit comments

Comments
 (0)