summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/helpers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-07 21:25:16 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-07 21:25:16 +0200
commit27af930d4ed1daf9f2710b005d103c7f1c7d919d (patch)
treeffe257a549ae70749dcf4646695a0d73535e237e /tests/codeigniter/helpers
parent87ac4260063e3a62805cc8f6f73cd2eb18da663a (diff)
parent928b9aa6340654b1dbb69af44c41468456f0b7b6 (diff)
Merge upstream branch
Diffstat (limited to 'tests/codeigniter/helpers')
-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