From 1255a42cfed9ce419962c6cf29181a66c7e22bb8 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 7 Jan 2017 14:28:58 +0100 Subject: 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` --- tests/UtilsTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/UtilsTest.php') diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index c885f552..b8f608b9 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -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)); + } + } -- cgit v1.2.3