summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codeigniter')
-rw-r--r--tests/codeigniter/helpers/text_helper_test.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/codeigniter/helpers/text_helper_test.php b/tests/codeigniter/helpers/text_helper_test.php
index 584066b0c..73e2b9429 100644
--- a/tests/codeigniter/helpers/text_helper_test.php
+++ b/tests/codeigniter/helpers/text_helper_test.php
@@ -122,7 +122,7 @@ class Text_helper_test extends CI_TestCase {
// ------------------------------------------------------------------------
- public function test_ellipsizing()
+ public function test_ellipsize()
{
$strs = array(
'0' => array(
@@ -156,4 +156,20 @@ class Text_helper_test extends CI_TestCase {
// ------------------------------------------------------------------------
+ public function test_word_wrap()
+ {
+ $string = "Here is a simple string of text that will help us demonstrate this function.";
+ $word_wrapped = word_wrap($string, 25);
+ $this->assertEquals(substr_count($word_wrapped, "\n"), 4);
+ }
+
+ // ------------------------------------------------------------------------
+
+ public function test_default_word_wrap_charlim()
+ {
+ $string = "Here is a longer string of text that will help us demonstrate the default charlim of this function.";
+ $word_wrapped = word_wrap($string);
+ $this->assertEquals(strpos($word_wrapped, "\n"), 73);
+ }
+
} \ No newline at end of file