From 321768d902f68a929a55ef9480c22cb54d40bd34 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 21 Apr 2011 12:09:33 -0500 Subject: Testing view loading. --- tests/codeigniter/core/Loader_test.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/codeigniter/core') diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php index d84928eca..782751cd7 100644 --- a/tests/codeigniter/core/Loader_test.php +++ b/tests/codeigniter/core/Loader_test.php @@ -117,6 +117,23 @@ class Loader_test extends CI_TestCase { // -------------------------------------------------------------------- + public function testLoadView() + { + $this->ci_set_core_class('output', 'CI_Output'); + + $content = 'This is my test page. '; + $view = vfsStream::newFile('unit_test_view.php')->withContent($content) + ->at($this->load->views_dir); + + // Use the optional return parameter in this test, so the view is not + // run through the output class. + $this->assertEquals('This is my test page. World!', + $this->load->view('unit_test_view', array('hello' => "World!"), TRUE)); + + } + + // -------------------------------------------------------------------- + public function testNonExistentView() { $this->setExpectedException( -- cgit v1.2.3-24-g4f1b