File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -2768,8 +2768,8 @@ protected static function stringify($value): string
2768
2768
} elseif (\is_scalar ($ value )) {
2769
2769
$ val = (string )$ value ;
2770
2770
2771
- if (\strlen ($ val ) > 100 ) {
2772
- $ val = \substr ($ val , 0 , 97 ).'... ' ;
2771
+ if (\mb_strlen ($ val ) > 100 ) {
2772
+ $ val = \mb_substr ($ val , 0 , 97 ).'... ' ;
2773
2773
}
2774
2774
2775
2775
$ result = $ val ;
Original file line number Diff line number Diff line change @@ -2103,6 +2103,18 @@ public function testStringifyTruncatesStringValuesLongerThan100CharactersAppropr
2103
2103
$ this ->assertTrue (Assertion::float ($ string ));
2104
2104
}
2105
2105
2106
+ /**
2107
+ * @expectedException \Assert\AssertionFailedException
2108
+ * @expectedExceptionCode \Assert\Assertion::INVALID_FLOAT
2109
+ * @expectedExceptionMessage ငါကနံပါတ်မဟုတ်ဘူးငါကနံပါတ်မဟုတ်ဘူးငါကနံပါတ်မဟုတ်ဘူးငါကနံပါတ်မဟုတ်ဘူးငါကနံပါတ်မဟုတ်ဘူးငါကနံပါတ်မဟု...
2110
+ */
2111
+ public function testStringifyTruncatesStringValuesLongerThan100CharactersAppropriatelyAndIsMultibyteValid ()
2112
+ {
2113
+ $ string = str_repeat ('ငါကနံပါတ်မဟုတ်ဘူး ' , 11 );
2114
+
2115
+ $ this ->assertTrue (Assertion::float ($ string ));
2116
+ }
2117
+
2106
2118
/**
2107
2119
* @expectedException \Assert\AssertionFailedException
2108
2120
* @expectedExceptionCode \Assert\Assertion::INVALID_FLOAT
You can’t perform that action at this time.
0 commit comments