Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ final class EnglishInflector implements InflectorInterface
* A list of words which should not be inflected, reversed.
*/
private static $uninflected = [
'',
'atad',
'reed',
'kcabdeef',
Expand Down
12 changes: 12 additions & 0 deletions src/Symfony/Component/String/Tests/EnglishInflectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,16 @@ public function testPluralize(string $singular, $plural)
{
$this->assertSame(\is_array($plural) ? $plural : [$plural], (new EnglishInflector())->pluralize($singular));
}

public function testPluralizeEmptyString()
{
$plural = (new EnglishInflector())->pluralize('');
$this->assertSame([''], $plural);
}

public function testSingularizeEmptyString()
{
$singular = (new EnglishInflector())->singularize('');
$this->assertSame([''], $singular);
}
}