summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/codeigniter/helpers/text_helper_test.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/codeigniter/helpers/text_helper_test.php b/tests/codeigniter/helpers/text_helper_test.php
index 974247c4f..d59b2743d 100644
--- a/tests/codeigniter/helpers/text_helper_test.php
+++ b/tests/codeigniter/helpers/text_helper_test.php
@@ -160,8 +160,17 @@ class Text_helper_test extends CI_TestCase {
{
$string = "Here is a simple string of text that will help us demonstrate this function.";
$word_wraped = word_wrap($string, 25);
- preg_match_all("/\r\n|\n/", $word_wraped, $matches);
- $this->assertEquals(count($matches[0]), 4);
+ $this->assertEquals(substr_count($word_wraped, "\n"), 4);
+ }
+
+ // ------------------------------------------------------------------------
+
+ public function test_default_word_wrap_charlim()
+ {
+ $string = "Here is a simple string of text that will help us demonstrate this function.";
+ $word_wraped = word_wrap($string);
+ $matches = preg_split("/\n/", $word_wraped, 1);
+ $this->assertEquals(strlen($matches[0]) - 1, 76);
}
} \ No newline at end of file