summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/helpers/text_helper_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codeigniter/helpers/text_helper_test.php')
-rw-r--r--tests/codeigniter/helpers/text_helper_test.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/codeigniter/helpers/text_helper_test.php b/tests/codeigniter/helpers/text_helper_test.php
index 5be1837b8..0713775da 100644
--- a/tests/codeigniter/helpers/text_helper_test.php
+++ b/tests/codeigniter/helpers/text_helper_test.php
@@ -2,21 +2,19 @@
class Text_helper_test extends CI_TestCase {
- private $_long_string;
-
public function set_up()
{
$this->helper('text');
-
- $this->_long_string = 'Once upon a time, a framework had no tests. It sad. So some nice people began to write tests. The more time that went on, the happier it became. Everyone was happy.';
}
// ------------------------------------------------------------------------
public function test_word_limiter()
{
- $this->assertEquals('Once upon a time,…', word_limiter($this->_long_string, 4));
- $this->assertEquals('Once upon a time,…', word_limiter($this->_long_string, 4, '…'));
+ $long_string = 'Once upon a time, a framework had no tests. It sad. So some nice people began to write tests. The more time that went on, the happier it became. Everyone was happy.';
+
+ $this->assertEquals('Once upon a time,…', word_limiter($long_string, 4));
+ $this->assertEquals('Once upon a time,…', word_limiter($long_string, 4, '…'));
$this->assertEquals('', word_limiter('', 4));
}
@@ -24,8 +22,10 @@ class Text_helper_test extends CI_TestCase {
public function test_character_limiter()
{
- $this->assertEquals('Once upon a time, a…', character_limiter($this->_long_string, 20));
- $this->assertEquals('Once upon a time, a…', character_limiter($this->_long_string, 20, '…'));
+ $long_string = 'Once upon a time, a framework had no tests. It sad. So some nice people began to write tests. The more time that went on, the happier it became. Everyone was happy.';
+
+ $this->assertEquals('Once upon a time, a…', character_limiter($long_string, 20));
+ $this->assertEquals('Once upon a time, a…', character_limiter($long_string, 20, '…'));
$this->assertEquals('Short', character_limiter('Short', 20));
$this->assertEquals('Short', character_limiter('Short', 5));
}
@@ -108,8 +108,13 @@ class Text_helper_test extends CI_TestCase {
// ------------------------------------------------------------------------
+ /**
+ * @runInSeparateProcess
+ */
public function test_highlight_phrase()
{
+ define('UTF8_ENABLED', FALSE);
+
$strs = array(
'this is a phrase' => '<mark>this is</mark> a phrase',
'this is another' => '<mark>this is</mark> another',