diff options
author | Andrey Andreev <narf@bofh.bg> | 2013-02-21 21:22:51 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2013-02-21 21:22:51 +0100 |
commit | eb291c1d1e1116a4420fa30e587adeea0451eeb7 (patch) | |
tree | 57b89d907ba0d5def611aae7ca25901647674cb2 /tests | |
parent | b3a5d6e8ad90644760890182a43ed81a23b86efe (diff) |
CI_Output [set/append/get]_output() tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/codeigniter/core/Output_test.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/codeigniter/core/Output_test.php b/tests/codeigniter/core/Output_test.php index 728df3bf6..0eeb93f7b 100644 --- a/tests/codeigniter/core/Output_test.php +++ b/tests/codeigniter/core/Output_test.php @@ -3,6 +3,16 @@ class Output_test extends CI_TestCase { public $output; + protected $_output_data = <<<HTML +<html> + <head> + <title>Basic HTML</title> + </head> + <body> + Test + </body> +</html> +HTML; public function set_up() { @@ -13,6 +23,31 @@ class Output_test extends CI_TestCase { // -------------------------------------------------------------------- + public function test_set_get_append_output() + { + $append = "<!-- comment /-->\n"; + + $this->assertEquals( + $this->_output_data.$append, + $this->output + ->set_output($this->_output_data) + ->append_output("<!-- comment /-->\n") + ->get_output() + ); + } + + // -------------------------------------------------------------------- + + public function test_minify() + { + $this->assertEquals( + str_replace(array("\t", "\n"), '', $this->_output_data), + $this->output->minify($this->_output_data) + ); + } + + // -------------------------------------------------------------------- + public function test_get_content_type() { $this->assertEquals('text/html', $this->output->get_content_type()); |