diff --git a/src/Symfony/Component/Inflector/Inflector.php b/src/Symfony/Component/Inflector/Inflector.php index 70ac51fc0dfa2..87cc6bd132ddc 100644 --- a/src/Symfony/Component/Inflector/Inflector.php +++ b/src/Symfony/Component/Inflector/Inflector.php @@ -310,6 +310,7 @@ final class Inflector * A list of words which should not be inflected, reversed. */ private static $uninflected = [ + '', 'atad', 'reed', 'kcabdeef', diff --git a/src/Symfony/Component/Inflector/Tests/InflectorTest.php b/src/Symfony/Component/Inflector/Tests/InflectorTest.php index 9a93125dd468f..a3c22ac0f5106 100644 --- a/src/Symfony/Component/Inflector/Tests/InflectorTest.php +++ b/src/Symfony/Component/Inflector/Tests/InflectorTest.php @@ -320,4 +320,16 @@ public function testPluralize($singular, $expectedPlural) $this->assertEquals($expectedPlural, $plural); } + + public function testPluralizeEmptyString() + { + $plural = Inflector::pluralize(''); + $this->assertSame('', $plural); + } + + public function testSingularizeEmptyString() + { + $singular = Inflector::singularize(''); + $this->assertSame('', $singular); + } }