summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-07 15:59:17 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-07 15:59:17 +0200
commit10bf82e23974082d8e62370fe77aaa07b3c83552 (patch)
treea4972f12be98b61ee0761fc4c50a62e265a80868 /tests/codeigniter
parentaf4d55da04b8d8750b59e04e46463d525237b74b (diff)
parent4215ddccd369ae8894c1031b97a344ae76eef5f6 (diff)
Merge pull request #1436 from jjaffeux/tests-text-helper
Tests text helper
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