Skip to content

Commit

Permalink
Word::pluralize not converting to lower case any longer
Browse files Browse the repository at this point in the history
  • Loading branch information
minond committed Nov 24, 2013
1 parent ccaace5 commit 0bb19f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Efficio/Utilitatis/Word.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ public function pluralForm($singular, $plural, $allowoverwrite = false)
*/
public function pluralize($word)
{
$word = strtolower($word);
$sword = strtolower($word);
$specials = array_merge(static::$specials, $this->myspecials);

if (array_key_exists($word, $specials)) {
$word = $specials[ $word ];
if (array_key_exists($sword, $specials)) {
$word = $specials[ $sword ];
} else if (substr($word, -1) !== 's') {
// yup
$word .= 's';
Expand Down
4 changes: 2 additions & 2 deletions tests/Utilitatis/WordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ public function testExistingSpecialPluralFormsCanBeOverwritten()

public function testNonSEndingWordsAreAppendedTheLetterSByDefault()
{
$this->assertEquals('marcos', $this->word->pluralize('Marco'));
$this->assertEquals('Marcos', $this->word->pluralize('Marco'));
}

public function testSEndingWordsAreNotAppendedTheLetterS()
{
$this->assertEquals('marcos', $this->word->pluralize('Marcos'));
$this->assertEquals('Marcos', $this->word->pluralize('Marcos'));
}

/**
Expand Down

0 comments on commit 0bb19f0

Please sign in to comment.