diff options
author | Andrey Andreev <narf@devilix.net> | 2014-01-07 15:30:42 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-01-07 15:30:42 +0100 |
commit | 0bb32d3c71bfc797c64b0c6611c520f5beef5621 (patch) | |
tree | 5ae8502f2396289b61e843f5eeaa2a7741980943 | |
parent | ac023e10e7d9e4ad11783ff7e1154d2701a1ec18 (diff) |
Update Text helper highlight_phrase() tests and add one for custom tags
-rw-r--r-- | tests/codeigniter/helpers/text_helper_test.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/codeigniter/helpers/text_helper_test.php b/tests/codeigniter/helpers/text_helper_test.php index d75d26208..7a7dc0a12 100644 --- a/tests/codeigniter/helpers/text_helper_test.php +++ b/tests/codeigniter/helpers/text_helper_test.php @@ -106,17 +106,19 @@ class Text_helper_test extends CI_TestCase { public function test_highlight_phrase() { $strs = array( - 'this is a phrase' => '<strong>this is</strong> a phrase', - 'this is another' => '<strong>this is</strong> another', - 'Gimme a test, Sally' => 'Gimme a test, Sally', - 'Or tell me what this is' => 'Or tell me what <strong>this is</strong>', - '' => '' + 'this is a phrase' => '<mark>this is</mark> a phrase', + 'this is another' => '<mark>this is</mark> another', + 'Gimme a test, Sally' => 'Gimme a test, Sally', + 'Or tell me what this is' => 'Or tell me what <mark>this is</mark>', + '' => '' ); foreach ($strs as $str => $expect) { $this->assertEquals($expect, highlight_phrase($str, 'this is')); } + + $this->assertEquals('<strong>this is</strong> a strong test', highlight_phrase('this is a strong test', 'this is', '<strong>', '</strong>')); } // ------------------------------------------------------------------------ |