Taufan Aditya | ca16c4f | 2012-03-28 15:15:30 +0700 | [diff] [blame] | 1 | <?php |
| 2 | |
Taufan Aditya | ca16c4f | 2012-03-28 15:15:30 +0700 | [diff] [blame] | 3 | class Mock_Core_URI extends CI_URI { |
Andrey Andreev | f243ce1 | 2012-06-09 23:34:21 +0300 | [diff] [blame] | 4 | |
Taufan Aditya | ca16c4f | 2012-03-28 15:15:30 +0700 | [diff] [blame] | 5 | public function __construct() |
| 6 | { |
| 7 | $test = CI_TestCase::instance(); |
| 8 | $cls =& $test->ci_core_class('cfg'); |
Andrey Andreev | f243ce1 | 2012-06-09 23:34:21 +0300 | [diff] [blame] | 9 | |
Taufan Aditya | ca16c4f | 2012-03-28 15:15:30 +0700 | [diff] [blame] | 10 | // set predictable config values |
| 11 | $test->ci_set_config(array( |
| 12 | 'index_page' => 'index.php', |
Andrey Andreev | de14aa5 | 2014-01-15 15:51:08 +0200 | [diff] [blame] | 13 | 'base_url' => 'http://example.com/', |
| 14 | 'subclass_prefix' => 'MY_', |
| 15 | 'enable_query_strings' => FALSE, |
| 16 | 'permitted_uri_chars' => 'a-z 0-9~%.:_\-' |
Taufan Aditya | ca16c4f | 2012-03-28 15:15:30 +0700 | [diff] [blame] | 17 | )); |
| 18 | |
Andrey Andreev | f243ce1 | 2012-06-09 23:34:21 +0300 | [diff] [blame] | 19 | $this->config = new $cls; |
Taufan Aditya | ca16c4f | 2012-03-28 15:15:30 +0700 | [diff] [blame] | 20 | |
Andrey Andreev | de14aa5 | 2014-01-15 15:51:08 +0200 | [diff] [blame] | 21 | if ($this->config->item('enable_query_strings') !== TRUE OR is_cli()) |
| 22 | { |
| 23 | $this->_permitted_uri_chars = $this->config->item('permitted_uri_chars'); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | public function _set_permitted_uri_chars($value) |
| 28 | { |
| 29 | $this->_permitted_uri_chars = $value; |
Taufan Aditya | ca16c4f | 2012-03-28 15:15:30 +0700 | [diff] [blame] | 30 | } |
Andrey Andreev | f243ce1 | 2012-06-09 23:34:21 +0300 | [diff] [blame] | 31 | |
Taufan Aditya | ca16c4f | 2012-03-28 15:15:30 +0700 | [diff] [blame] | 32 | } |