summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/core
diff options
context:
space:
mode:
authorGreg Aker <greg.aker@ellislab.com>2011-04-21 19:09:33 +0200
committerGreg Aker <greg.aker@ellislab.com>2011-04-21 19:09:33 +0200
commit321768d902f68a929a55ef9480c22cb54d40bd34 (patch)
tree4c01753a9b752ae409710046bb0f37442cf76f0c /tests/codeigniter/core
parentdeab6ad864f05367e2c122906f63d24286b731d1 (diff)
Testing view loading.
Diffstat (limited to 'tests/codeigniter/core')
-rw-r--r--tests/codeigniter/core/Loader_test.php17
1 files changed, 17 insertions, 0 deletions
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. <?php echo $hello; ?>';
+ $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(