Fix TextHelper.php & correct unit tests