From c186288755aba46a2b6f0c3f104d9a6ce6b11a7f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 9 Jun 2012 23:16:58 +0300 Subject: Cleanup/optimize tests/codeigniter/ --- tests/codeigniter/libraries/Typography_test.php | 40 ++++++++++++------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'tests/codeigniter/libraries/Typography_test.php') diff --git a/tests/codeigniter/libraries/Typography_test.php b/tests/codeigniter/libraries/Typography_test.php index 250aefb24..eb6dacb73 100644 --- a/tests/codeigniter/libraries/Typography_test.php +++ b/tests/codeigniter/libraries/Typography_test.php @@ -4,11 +4,11 @@ class Typography_test extends CI_TestCase { public function set_up() { - $obj = new StdClass; + $obj = new stdClass; $obj->type = new Mock_Libraries_Typography(); - + $this->ci_instance($obj); - + $this->type = $obj->type; } @@ -33,18 +33,18 @@ class Typography_test extends CI_TestCase { 'foo..' => 'foo..', 'foo...bar.' => 'foo…bar.', 'test. new' => 'test.  new', - ); - + ); + foreach ($strs as $str => $expected) { - $this->assertEquals($expected, $this->type->format_characters($str)); + $this->assertEquals($expected, $this->type->format_characters($str)); } } // -------------------------------------------------------------------- public function test_nl2br_except_pre() - { + { $str = << The End. EOH; - $this->assertEquals($expected, - $this->type->nl2br_except_pre($str)); + $this->assertEquals($expected, $this->type->nl2br_except_pre($str)); } // -------------------------------------------------------------------- - + public function test_auto_typography() { $this->_blank_string(); @@ -103,7 +102,7 @@ EOH; } // -------------------------------------------------------------------- - + private function _blank_string() { // Test blank string @@ -131,7 +130,7 @@ EOH; { $str = "This has way too many linebreaks.\n\n\n\nSee?"; $expect = "

This has way too many linebreaks.

\n\n

See?

"; - + $this->assertEquals($expect, $this->type->auto_typography($str, TRUE)); } @@ -141,7 +140,7 @@ EOH; { $str = ' But no!'; $expect = '

  But no!

'; - + $this->assertEquals($expect, $this->type->auto_typography($str)); } @@ -151,7 +150,7 @@ EOH; { $str = '

My Sentence

var_dump($this);
'; $expect = '

My Sentence

var_dump($this);
'; - + $this->assertEquals($expect, $this->type->auto_typography($str)); } @@ -161,7 +160,7 @@ EOH; { $str = 'My Sentence
var_dump($this);
'; $expect = '

My Sentence

var_dump($this);
'; - + $this->assertEquals($expect, $this->type->auto_typography($str)); } @@ -170,19 +169,18 @@ EOH; public function _protect_braced_quotes() { $this->type->protect_braced_quotes = TRUE; - + $str = 'Test {parse="foobar"}'; $expect = '

Test {parse="foobar"}

'; - + $this->assertEquals($expect, $this->type->auto_typography($str)); $this->type->protect_braced_quotes = FALSE; - + $str = 'Test {parse="foobar"}'; $expect = '

Test {parse=“foobar”}

'; - - $this->assertEquals($expect, $this->type->auto_typography($str)); - + $this->assertEquals($expect, $this->type->auto_typography($str)); } + } \ No newline at end of file -- cgit v1.2.3-24-g4f1b