mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding waves -> wave as irregular singularization rule. Fixes #47.
This commit is contained in:
parent
47d9181313
commit
6f8f4c5a05
2 changed files with 7 additions and 2 deletions
|
@ -318,7 +318,8 @@ class Inflector extends Object {
|
||||||
'nexus', 'Niasese', 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', 'proceedings',
|
'nexus', 'Niasese', 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', 'proceedings',
|
||||||
'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors', 'sea[- ]bass', 'series', 'Shavese', 'shears',
|
'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors', 'sea[- ]bass', 'series', 'Shavese', 'shears',
|
||||||
'siemens', 'species', 'swine', 'testes', 'trousers', 'trout', 'tuna', 'Vermontese', 'Wenchowese',
|
'siemens', 'species', 'swine', 'testes', 'trousers', 'trout', 'tuna', 'Vermontese', 'Wenchowese',
|
||||||
'whiting', 'wildebeest', 'Yengeese');
|
'whiting', 'wildebeest', 'Yengeese'
|
||||||
|
);
|
||||||
|
|
||||||
$coreIrregularSingular = array(
|
$coreIrregularSingular = array(
|
||||||
'atlases' => 'atlas',
|
'atlases' => 'atlas',
|
||||||
|
@ -349,7 +350,9 @@ class Inflector extends Object {
|
||||||
'soliloquies' => 'soliloquy',
|
'soliloquies' => 'soliloquy',
|
||||||
'testes' => 'testis',
|
'testes' => 'testis',
|
||||||
'trilbys' => 'trilby',
|
'trilbys' => 'trilby',
|
||||||
'turfs' => 'turf');
|
'turfs' => 'turf',
|
||||||
|
'waves' => 'wave'
|
||||||
|
);
|
||||||
|
|
||||||
$singularRules = Set::pushDiff($this->__singularRules, $coreSingularRules);
|
$singularRules = Set::pushDiff($this->__singularRules, $coreSingularRules);
|
||||||
$uninflected = Set::pushDiff($this->__uninflectedSingular, $coreUninflectedSingular);
|
$uninflected = Set::pushDiff($this->__uninflectedSingular, $coreUninflectedSingular);
|
||||||
|
|
|
@ -108,6 +108,7 @@ class InflectorTest extends CakeTestCase {
|
||||||
$this->assertEqual(Inflector::singularize('taxes'), 'tax');
|
$this->assertEqual(Inflector::singularize('taxes'), 'tax');
|
||||||
$this->assertEqual(Inflector::singularize('faxes'), 'fax');
|
$this->assertEqual(Inflector::singularize('faxes'), 'fax');
|
||||||
$this->assertEqual(Inflector::singularize('waxes'), 'wax');
|
$this->assertEqual(Inflector::singularize('waxes'), 'wax');
|
||||||
|
$this->assertEqual(Inflector::singularize('waves'), 'wave');
|
||||||
$this->assertEqual(Inflector::singularize(''), '');
|
$this->assertEqual(Inflector::singularize(''), '');
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -151,6 +152,7 @@ class InflectorTest extends CakeTestCase {
|
||||||
$this->assertEqual(Inflector::pluralize('people'), 'people');
|
$this->assertEqual(Inflector::pluralize('people'), 'people');
|
||||||
$this->assertEqual(Inflector::pluralize('glove'), 'gloves');
|
$this->assertEqual(Inflector::pluralize('glove'), 'gloves');
|
||||||
$this->assertEqual(Inflector::pluralize('crisis'), 'crises');
|
$this->assertEqual(Inflector::pluralize('crisis'), 'crises');
|
||||||
|
$this->assertEqual(Inflector::pluralize('wave'), 'waves');
|
||||||
$this->assertEqual(Inflector::pluralize(''), '');
|
$this->assertEqual(Inflector::pluralize(''), '');
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue