blob: 591214bdecd8742cac06147bd80dc1939ce09117 [file] [log] [blame]
Hamza Bhatti756516d2012-03-12 09:47:34 +04001<?php
2
3require BASEPATH . 'helpers/path_helper.php';
4
5class Path_helper_test extends CI_TestCase
6{
7 public function test_set_realpath()
8 {
9 $expected = getcwd() . '/';
10 $this->assertEquals($expected, set_realpath(getcwd()));
11 }
12
13 public function test_set_realpath_nonexistent_directory()
14 {
15 $expected = '/path/to/nowhere';
16 $this->assertEquals($expected, set_realpath('/path/to/nowhere', FALSE));
17 }
18
19 public function test_set_realpath_error_trigger()
20 {
21 $this->setExpectedException(
22 'RuntimeException', 'CI Error: Not a valid path: /path/to/nowhere'
23 );
24
25 set_realpath('/path/to/nowhere', TRUE);
26 }
27}
28
29/* End of file path_helper_test.php */