blob: 96ec5afa1f4adce7e923bf0166bd8ff130ef7bb6 [file] [log] [blame]
Taufan Adityaca16c4f2012-03-28 15:15:30 +07001<?php
2
Taufan Adityaca16c4f2012-03-28 15:15:30 +07003class Mock_Core_URI extends CI_URI {
Andrey Andreevf243ce12012-06-09 23:34:21 +03004
Taufan Adityaca16c4f2012-03-28 15:15:30 +07005 public function __construct()
6 {
7 $test = CI_TestCase::instance();
8 $cls =& $test->ci_core_class('cfg');
Andrey Andreevf243ce12012-06-09 23:34:21 +03009
Taufan Adityaca16c4f2012-03-28 15:15:30 +070010 // set predictable config values
11 $test->ci_set_config(array(
12 'index_page' => 'index.php',
Andrey Andreevde14aa52014-01-15 15:51:08 +020013 'base_url' => 'http://example.com/',
14 'subclass_prefix' => 'MY_',
15 'enable_query_strings' => FALSE,
16 'permitted_uri_chars' => 'a-z 0-9~%.:_\-'
Taufan Adityaca16c4f2012-03-28 15:15:30 +070017 ));
18
Andrey Andreevf243ce12012-06-09 23:34:21 +030019 $this->config = new $cls;
Taufan Adityaca16c4f2012-03-28 15:15:30 +070020
Andrey Andreevde14aa52014-01-15 15:51:08 +020021 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 Adityaca16c4f2012-03-28 15:15:30 +070030 }
Andrey Andreevf243ce12012-06-09 23:34:21 +030031
Taufan Adityaca16c4f2012-03-28 15:15:30 +070032}