From eb291c1d1e1116a4420fa30e587adeea0451eeb7 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 21 Feb 2013 22:22:51 +0200 Subject: CI_Output [set/append/get]_output() tests --- tests/codeigniter/core/Output_test.php | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'tests/codeigniter/core/Output_test.php') 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 = << + + Basic HTML + + + Test + + +HTML; public function set_up() { @@ -13,6 +23,31 @@ class Output_test extends CI_TestCase { // -------------------------------------------------------------------- + public function test_set_get_append_output() + { + $append = "\n"; + + $this->assertEquals( + $this->_output_data.$append, + $this->output + ->set_output($this->_output_data) + ->append_output("\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()); -- cgit v1.2.3-24-g4f1b