[String] Fix Notice when argument is empty string
This commit is contained in:
parent
586f5b72da
commit
88c2b9be62
@ -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',
|
||||
|
@ -306,4 +306,16 @@ class EnglishInflectorTest extends TestCase
|
||||
{
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user