Hamza Bhatti | 756516d | 2012-03-12 09:47:34 +0400 | [diff] [blame] | 1 | <?php |
| 2 | |
Taufan Aditya | e1dc9ea | 2012-03-28 16:49:49 +0700 | [diff] [blame] | 3 | class Path_helper_test extends CI_TestCase { |
Hamza Bhatti | 756516d | 2012-03-12 09:47:34 +0400 | [diff] [blame] | 4 | |
Taufan Aditya | e1dc9ea | 2012-03-28 16:49:49 +0700 | [diff] [blame] | 5 | public function set_up() |
| 6 | { |
| 7 | $this->helper('path'); |
| 8 | } |
| 9 | |
Hamza Bhatti | 756516d | 2012-03-12 09:47:34 +0400 | [diff] [blame] | 10 | public function test_set_realpath() |
Andrey Andreev | 99b782d | 2012-06-09 22:24:46 +0300 | [diff] [blame] | 11 | { |
| 12 | $this->assertEquals(getcwd().DIRECTORY_SEPARATOR, set_realpath(getcwd())); |
Hamza Bhatti | 756516d | 2012-03-12 09:47:34 +0400 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | public function test_set_realpath_nonexistent_directory() |
| 16 | { |
| 17 | $expected = '/path/to/nowhere'; |
| 18 | $this->assertEquals($expected, set_realpath('/path/to/nowhere', FALSE)); |
| 19 | } |
| 20 | |
| 21 | public function test_set_realpath_error_trigger() |
| 22 | { |
| 23 | $this->setExpectedException( |
| 24 | 'RuntimeException', 'CI Error: Not a valid path: /path/to/nowhere' |
| 25 | ); |
| 26 | |
| 27 | set_realpath('/path/to/nowhere', TRUE); |
| 28 | } |
Andrey Andreev | 838a9d6 | 2012-12-03 14:37:47 +0200 | [diff] [blame] | 29 | |
Hamza Bhatti | 756516d | 2012-03-12 09:47:34 +0400 | [diff] [blame] | 30 | } |