diff --git a/framework/helpers/BaseInflector.php b/framework/helpers/BaseInflector.php index 039e70d589..d8754be040 100644 --- a/framework/helpers/BaseInflector.php +++ b/framework/helpers/BaseInflector.php @@ -51,6 +51,7 @@ class BaseInflector '/us$/i' => 'uses', '/(alias)$/i' => '\1es', '/(ax|cris|test)is$/i' => '\1es', + '/(currenc)y$/' => '\1ies', '/s$/' => 's', '/^$/' => '', '/$/' => 's', @@ -97,6 +98,7 @@ class BaseInflector '/(n)ews$/i' => '\1\2ews', '/(n)etherlands$/i' => '\1\2etherlands', '/eaus$/' => 'eau', + '/(currenc)ies$/' => '\1y', '/^(.*us)$/' => '\\1', '/s$/i' => '', ]; diff --git a/tests/framework/helpers/InflectorTest.php b/tests/framework/helpers/InflectorTest.php index 4a9a1c6d44..713b3c7c9d 100644 --- a/tests/framework/helpers/InflectorTest.php +++ b/tests/framework/helpers/InflectorTest.php @@ -31,6 +31,7 @@ class InflectorTest extends TestCase 'test' => 'tests', 'car' => 'cars', 'netherlands' => 'netherlands', + 'currency' => 'currencies', ]; foreach ($testData as $testIn => $testOut) { @@ -59,6 +60,7 @@ class InflectorTest extends TestCase 'tests' => 'test', 'cars' => 'car', 'Netherlands' => 'Netherlands', + 'currencies' => 'currency', ]; foreach ($testData as $testIn => $testOut) { $this->assertEquals($testOut, Inflector::singularize($testIn));