blob: 632f57501bda879ed7418a5914970d3f35873773 [file] [log] [blame]
Hamza Bhatti756516d2012-03-12 09:47:34 +04001<?php
2
Taufan Adityae1dc9ea2012-03-28 16:49:49 +07003class Path_helper_test extends CI_TestCase {
Hamza Bhatti756516d2012-03-12 09:47:34 +04004
Taufan Adityae1dc9ea2012-03-28 16:49:49 +07005 public function set_up()
6 {
7 $this->helper('path');
8 }
9
Hamza Bhatti756516d2012-03-12 09:47:34 +040010 public function test_set_realpath()
11 {
Hamza Bhatti3ec336f2012-03-14 13:50:23 +040012 $expected = getcwd() . DIRECTORY_SEPARATOR;
Hamza Bhatti756516d2012-03-12 09:47:34 +040013 $this->assertEquals($expected, set_realpath(getcwd()));
14 }
15
16 public function test_set_realpath_nonexistent_directory()
17 {
18 $expected = '/path/to/nowhere';
19 $this->assertEquals($expected, set_realpath('/path/to/nowhere', FALSE));
20 }
21
22 public function test_set_realpath_error_trigger()
23 {
24 $this->setExpectedException(
25 'RuntimeException', 'CI Error: Not a valid path: /path/to/nowhere'
26 );
27
28 set_realpath('/path/to/nowhere', TRUE);
29 }
30}
31
32/* End of file path_helper_test.php */