blob: 2e6cc6391f6c31bebc6d902bf2e5f00fcae1bf48 [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 {
Hamza Bhatti3ec336f2012-03-14 13:50:23 +04009 $expected = getcwd() . DIRECTORY_SEPARATOR;
Hamza Bhatti756516d2012-03-12 09:47:34 +040010 $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 */