mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-29 01:17:13 +08:00
Fix #19526: Add the convertIniSizeToBytes method to BaseStringHelper
This commit is contained in:
@ -536,4 +536,25 @@ class StringHelperTest extends TestCase
|
||||
['من صالح هاشمی هستم', 'من ', ' هستم', 'صالح هاشمی'], // other languages
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideConvertIniSizeToBytesData
|
||||
*/
|
||||
public function testConvertIniSizeToBytes(string $string, int $expectedResult): void
|
||||
{
|
||||
$this->assertEquals($expectedResult, StringHelper::convertIniSizeToBytes($string));
|
||||
}
|
||||
|
||||
public static function provideConvertIniSizeToBytesData(): array
|
||||
{
|
||||
return [
|
||||
['1024', 1024],
|
||||
['512K', 524288],
|
||||
['512k', 524288],
|
||||
['128M', 134217728],
|
||||
['128m', 134217728],
|
||||
['2G', 2147483648],
|
||||
['2g', 2147483648],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user