Fix TextHelper.php & correct unit tests
Fix TextHelper.php