diff --git a/src/Symfony/Component/Inflector/Inflector.php b/src/Symfony/Component/Inflector/Inflector.php index 70ac51fc0d..87cc6bd132 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 9a93125dd4..a3c22ac0f5 100644 --- a/src/Symfony/Component/Inflector/Tests/InflectorTest.php +++ b/src/Symfony/Component/Inflector/Tests/InflectorTest.php @@ -320,4 +320,16 @@ class InflectorTest extends TestCase $this->assertEquals($expectedPlural, $plural); } + + public function testPluralizeEmptyString() + { + $plural = Inflector::pluralize(''); + $this->assertSame('', $plural); + } + + public function testSingularizeEmptyString() + { + $singular = Inflector::singularize(''); + $this->assertSame('', $singular); + } }