Skip to content

Commit

Permalink
Write a function testIsMultibyteString() for testing isMultibyte() me…
Browse files Browse the repository at this point in the history
…thod of Utility/Text Class
  • Loading branch information
sohelrana820 committed Mar 16, 2018
1 parent 79ef344 commit 6d122ae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/TestCase/Utility/TextTest.php
Expand Up @@ -537,6 +537,17 @@ public function testWrapBlockIndentWithMultibyte()
$this->assertTextEquals($expected, $result);
}

public function testIsMultibyteString()
{
$text = 'This is a test string without multi-bytes';
$result = Text::isMultibyte($text);
$this->assertFalse($result);

$text = 'This is a test string with multi-bytes 这是永远不会结束的歌曲';
$result = Text::isMultibyte($text);
$this->assertTrue($result);
}

/**
* testTruncate method
*
Expand Down

0 comments on commit 6d122ae

Please sign in to comment.