mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Added 'software' and 'hardware' string to BaseInflector $specials.
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @link http://www.yiiframework.com/
|
* @link http://www.yiiframework.com/
|
||||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||||
@ -219,6 +220,10 @@ class BaseInflector
|
|||||||
'whiting' => 'whiting',
|
'whiting' => 'whiting',
|
||||||
'wildebeest' => 'wildebeest',
|
'wildebeest' => 'wildebeest',
|
||||||
'Yengeese' => 'Yengeese',
|
'Yengeese' => 'Yengeese',
|
||||||
|
'software' => 'software',
|
||||||
|
'Software' => 'Software',
|
||||||
|
'hardware' => 'hardware',
|
||||||
|
'Hardware' => 'Hardware',
|
||||||
];
|
];
|
||||||
/**
|
/**
|
||||||
* @var array fallback map for transliteration used by [[transliterate()]] when intl isn't available.
|
* @var array fallback map for transliteration used by [[transliterate()]] when intl isn't available.
|
||||||
@ -619,5 +624,4 @@ class BaseInflector
|
|||||||
{
|
{
|
||||||
return isset(Yii::$app) ? Yii::$app->charset : 'UTF-8';
|
return isset(Yii::$app) ? Yii::$app->charset : 'UTF-8';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @link http://www.yiiframework.com/
|
* @link http://www.yiiframework.com/
|
||||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||||
@ -44,6 +45,8 @@ class InflectorTest extends TestCase
|
|||||||
'car' => 'cars',
|
'car' => 'cars',
|
||||||
'netherlands' => 'netherlands',
|
'netherlands' => 'netherlands',
|
||||||
'currency' => 'currencies',
|
'currency' => 'currencies',
|
||||||
|
'software' => 'software',
|
||||||
|
'hardware' => 'hardware',
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($testData as $testIn => $testOut) {
|
foreach ($testData as $testIn => $testOut) {
|
||||||
@ -73,6 +76,8 @@ class InflectorTest extends TestCase
|
|||||||
'cars' => 'car',
|
'cars' => 'car',
|
||||||
'Netherlands' => 'Netherlands',
|
'Netherlands' => 'Netherlands',
|
||||||
'currencies' => 'currency',
|
'currencies' => 'currency',
|
||||||
|
'software' => 'software',
|
||||||
|
'hardware' => 'hardware',
|
||||||
];
|
];
|
||||||
foreach ($testData as $testIn => $testOut) {
|
foreach ($testData as $testIn => $testOut) {
|
||||||
$this->assertEquals($testOut, Inflector::singularize($testIn));
|
$this->assertEquals($testOut, Inflector::singularize($testIn));
|
||||||
|
|||||||
Reference in New Issue
Block a user