blob: 9d325e70de89decfb500f4b85d8bf015ea591d0e [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()
Andrey Andreev99b782d2012-06-09 22:24:46 +030011 {
12 $this->assertEquals(getcwd().DIRECTORY_SEPARATOR, set_realpath(getcwd()));
Hamza Bhatti756516d2012-03-12 09:47:34 +040013 }
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 Andreev838a9d62012-12-03 14:37:47 +020029
Hamza Bhatti756516d2012-03-12 09:47:34 +040030}