diff options
author | Andrey Andreev <narf@devilix.net> | 2014-01-18 16:36:07 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-01-18 16:36:07 +0100 |
commit | ecaef964232f7889eb3eab35b69cebbf3221ad66 (patch) | |
tree | 56759ff61e0512db9debfceb6f119ea3ea4dc911 /tests/codeigniter/core/Model_test.php | |
parent | 60f71be48a6b91cc314908c3c0007f13e9cb2f0a (diff) | |
parent | b2a0e70585367e59bf2d106629c0e9c3ab1370c2 (diff) |
Merge branch 'develop' into feature/output_compressed_cache
Diffstat (limited to 'tests/codeigniter/core/Model_test.php')
-rw-r--r-- | tests/codeigniter/core/Model_test.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/codeigniter/core/Model_test.php b/tests/codeigniter/core/Model_test.php new file mode 100644 index 000000000..80dc97b3b --- /dev/null +++ b/tests/codeigniter/core/Model_test.php @@ -0,0 +1,37 @@ +<?php + +class Model_test extends CI_TestCase { + + private $ci_obj; + + public function set_up() + { + $loader = $this->ci_core_class('loader'); + $this->load = new $loader(); + $this->ci_obj = $this->ci_instance(); + $this->ci_set_core_class('model', 'CI_Model'); + + $model_code =<<<MODEL +<?php +class Test_model extends CI_Model { + + public \$property = 'foo'; + +} +MODEL; + + $this->ci_vfs_create('Test_model', $model_code, $this->ci_app_root, 'models'); + $this->load->model('test_model'); + } + + // -------------------------------------------------------------------- + + public function test__get() + { + $this->assertEquals('foo', $this->ci_obj->test_model->property); + + $this->ci_obj->controller_property = 'bar'; + $this->assertEquals('bar', $this->ci_obj->test_model->controller_property); + } + +}
\ No newline at end of file |