summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/helpers/text_helper_test.php
diff options
context:
space:
mode:
authorJoffrey Jaffeux <j.jaffeux@gmail.com>2012-06-07 20:00:59 +0200
committerJoffrey Jaffeux <j.jaffeux@gmail.com>2012-06-07 20:00:59 +0200
commitbb2da6fafaab754aee3e6745bf23db52e3aed57d (patch)
tree85fd992a15d4ed1800218aedffa8a3aa09931ff2 /tests/codeigniter/helpers/text_helper_test.php
parent9d1407523ae585d45171b54123ba29c0ec831f79 (diff)
parent25d47aec0417e52af43985663ebc1f62931f13cd (diff)
Merge https://github.com/EllisLab/CodeIgniter into test-encryption-class
Diffstat (limited to 'tests/codeigniter/helpers/text_helper_test.php')
-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