diff --git a/lib/SMSCounter.php b/lib/SMSCounter.php index c846b8d..ab3357f 100644 --- a/lib/SMSCounter.php +++ b/lib/SMSCounter.php @@ -46,9 +46,9 @@ public static function int_gsm_7bit_map(){ return array(10,13,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50, 51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70, 71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90, - 92,95,97,98,99,100,101,102,103,104,105,106,107,108,109,110, + 95,97,98,99,100,101,102,103,104,105,106,107,108,109,110, 111,112,113,114,115,116,117,118,119,120,121,122, - 161,163,164,165,191,196,197,198,199,201,209,214, + 161,163,164,165,167,191,196,197,198,199,201,209,214, 216,220,223,224,228,229,230,232,233,236,241,242, 246,248,249,252,915,916,920,923,926,928,931,934, 936,937); diff --git a/tests/test.php b/tests/test.php index 432c2b5..f4d44fe 100644 --- a/tests/test.php +++ b/tests/test.php @@ -32,10 +32,22 @@ public function testIntMapIsComplete(){ } public function testEachGSM(){ - $character_set = SMSCounter::gsm_7bit_chars; - $len = strlen($character_set); + $character_set = array("@", "£", "\$", "¥", "è", "é", "ù", "ì", "ò", "Ç", + "\n", "Ø", "ø", "\r", "Å", "å", "Δ", "_", "Φ", "Γ", + "Λ", "Ω", "Π", "Ψ", "Σ", "Θ", "Ξ", "Æ", "æ", "ß", + "É", " ", "!", "\"", "#", "¤", "%", "&", "'", "(", + ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", + "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", + "=", ">", "?", "¡", "A", "B", "C", "D", "E", "F", + "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", + "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", + "Ä", "Ö", "Ñ", "Ü", "§", "¿", "a", "b", "c", "d", + "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", + "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", + "y", "z", "ä", "ö", "ñ", "ü", "à"); + $len = count($character_set); for($i = 0; $i< $len; $i++){ - $this->assertEquals(SMSCounter::GSM_7BIT, SMSCounter::count($character_set[$i]."")->encoding, sprintf("Testing for character %s for GSM_7BIT", $character_set[$i]."")); + $this->assertEquals(SMSCounter::GSM_7BIT, SMSCounter::count($character_set[$i])->encoding, sprintf("Testing for character %s for GSM_7BIT", $character_set[$i])); } $extra_character_set = array("|", "^", "{", "}", "[", "]", "~", "\\", "€"); for($i = 0; $i< count($extra_character_set); $i++){