Skip to content

Commit 8dc0f5b

Browse files
authored
Fix the cedilla test, fix the engine to treat input string as UTF-8 because unicode in PHP is a miserable experience. (#403)
1 parent 53a204b commit 8dc0f5b

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

phpunit.xml.dist

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
<testsuite name="verify2">
2424
<directory>test/Verify2</directory>
2525
</testsuite>
26+
<testsuite name="messages">
27+
<directory>test/Messages</directory>
28+
</testsuite>
2629
</testsuites>
2730
<php>
2831
<ini name='error_reporting' value='E_ALL' />

src/SMS/Message/SMS.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(string $to, string $from, protected string $message,
3232

3333
public static function isGsm7(string $message): bool
3434
{
35-
$fullPattern = "/\A[" . preg_quote(self::GSM_7_CHARSET, '/') . "]*\z/";
35+
$fullPattern = "/\A[" . preg_quote(self::GSM_7_CHARSET, '/') . "]*\z/u";
3636
return (bool)preg_match($fullPattern, $message);
3737
}
3838

test/SMS/Message/SMSTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function unicodeStringDataProvider(): array
185185
['This is a text with some tasty characters: [test]', true],
186186
['This is also a GSM7 text', true],
187187
['This is a Çotcha', true],
188-
['This is also a çotcha', true],
188+
['This is also a çotcha', false],
189189
['日本語でボナージュ', false],
190190
];
191191
}

0 commit comments

Comments
 (0)