Improve autoLocale() detection
- Creates arrays_combination function to cover all cases - add the underscore separator in the regex - add `utf8` encoding in addition to `UTF-8`
This commit is contained in:
parent
236239be75
commit
1255a42cfe
2 changed files with 62 additions and 9 deletions
tests
|
@ -282,4 +282,24 @@ class UtilsTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertEquals('', normalize_spaces(''));
|
||||
$this->assertEquals(null, normalize_spaces(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test arrays_combine
|
||||
*/
|
||||
public function testArraysCombination()
|
||||
{
|
||||
$arr = [['ab', 'cd'], ['ef', 'gh'], ['ij', 'kl'], ['m']];
|
||||
$expected = [
|
||||
'abefijm',
|
||||
'cdefijm',
|
||||
'abghijm',
|
||||
'cdghijm',
|
||||
'abefklm',
|
||||
'cdefklm',
|
||||
'abghklm',
|
||||
'cdghklm',
|
||||
];
|
||||
$this->assertEquals($expected, arrays_combination($arr));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue