diff options
author | Christian Mohr <christian.mohr@insitu.de> | 2018-03-07 19:05:20 +0100 |
---|---|---|
committer | Christian Mohr <christian.mohr@insitu.de> | 2018-03-07 19:05:20 +0100 |
commit | 6b7fc8fc1826406d5c6d04afe2c39a36e5522609 (patch) | |
tree | f5dca72349f4a86a03c3f33599e1a652492c35ec /tests/codeigniter/core/Loader_test.php | |
parent | bbb3d55f6e0315faf03dcf894709cc04d6109179 (diff) |
added test for nested view
Diffstat (limited to 'tests/codeigniter/core/Loader_test.php')
-rw-r--r-- | tests/codeigniter/core/Loader_test.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php index df698f30c..f043d1fcc 100644 --- a/tests/codeigniter/core/Loader_test.php +++ b/tests/codeigniter/core/Loader_test.php @@ -318,6 +318,15 @@ class Loader_test extends CI_TestCase { $vars = new stdClass(); $vars->$var = $value; $this->assertInstanceOf('CI_Loader', $this->load->view($view, $vars)); + + // Create another view in VFS, nesting the first one without its own $vars + $nesting_view = 'unit_test_nesting_view'; + $nesting_content = 'Here comes a nested view. '; + $this->ci_vfs_create($nesting_view, $nesting_content.'<?php $loader->view("'.$view.'");', $this->ci_app_root, 'views'); + + // Test $vars inheritance to nested views + $out = $this->load->view($nesting_view, array("loader" => $this->load, $var => $value), TRUE); + $this->assertEquals($nesting_content.$content.$value, $out); } // -------------------------------------------------------------------- |