mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 20:19:42 +08:00
Fixes #16266: Fixed yii\helpers\BaseStringHelper where explode would not allow 0 as trim string
This commit is contained in:
committed by
Alexander Makarov
parent
e4b559d720
commit
a32cfcc8ef
@ -267,6 +267,7 @@ class StringHelperTest extends TestCase
|
||||
$this->assertEquals(['It', 'is', 'a test with trimmed digits', '0', '1', '2'], StringHelper::explode('It, is, a test with trimmed digits, 0, 1, 2', ',', true, true));
|
||||
$this->assertEquals(['It', 'is', 'a second', 'test'], StringHelper::explode('It+ is+ a second+ test', '+'));
|
||||
$this->assertEquals(['Save', '', '', 'empty trimmed string'], StringHelper::explode('Save, ,, empty trimmed string', ','));
|
||||
$this->assertEquals(['44', '512'], StringHelper::explode('0 0 440 512', ' ', '0', true));
|
||||
$this->assertEquals(['Здесь', 'multibyte', 'строка'], StringHelper::explode('Здесь我 multibyte我 строка', '我'));
|
||||
$this->assertEquals(['Disable', ' trim ', 'here but ignore empty'], StringHelper::explode('Disable, trim ,,,here but ignore empty', ',', false, true));
|
||||
$this->assertEquals(['It/', ' is?', ' a', ' test with rtrim'], StringHelper::explode('It/, is?, a , test with rtrim', ',', 'rtrim'));
|
||||
|
||||
Reference in New Issue
Block a user