summaryrefslogtreecommitdiffstats
path: root/tests/mocks/core
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-01-20 14:03:43 +0100
committerAndrey Andreev <narf@devilix.net>2014-01-20 14:03:43 +0100
commitea801ab4ab80042638ffddc6056483a1ec43fa80 (patch)
treef75f30c0df6a8f861ca7df22af09fa3240b0bbd6 /tests/mocks/core
parent1c08d557a21ecb0f79cd1a1de4e06817a26e0537 (diff)
parent4d0571666d03511ac5b4a1f2a6882ccb1509a209 (diff)
Merge branch 'develop' into feature/user-guide-cleanup
Diffstat (limited to 'tests/mocks/core')
-rw-r--r--tests/mocks/core/common.php11
-rw-r--r--tests/mocks/core/uri.php14
-rw-r--r--tests/mocks/core/utf8.php5
3 files changed, 25 insertions, 5 deletions
diff --git a/tests/mocks/core/common.php b/tests/mocks/core/common.php
index 0ccfe1ea4..b073f230d 100644
--- a/tests/mocks/core/common.php
+++ b/tests/mocks/core/common.php
@@ -178,7 +178,7 @@ if ( ! function_exists('is_loaded'))
if ( ! function_exists('log_message'))
{
- function log_message($level, $message, $php_error = FALSE)
+ function log_message($level, $message)
{
return TRUE;
}
@@ -190,4 +190,13 @@ if ( ! function_exists('set_status_header'))
{
return TRUE;
}
+}
+
+if ( ! function_exists('is_cli'))
+{
+ // In order to test HTTP functionality, we need to lie about this
+ function is_cli()
+ {
+ return FALSE;
+ }
} \ No newline at end of file
diff --git a/tests/mocks/core/uri.php b/tests/mocks/core/uri.php
index 94f75df64..96ec5afa1 100644
--- a/tests/mocks/core/uri.php
+++ b/tests/mocks/core/uri.php
@@ -10,17 +10,23 @@ class Mock_Core_URI extends CI_URI {
// set predictable config values
$test->ci_set_config(array(
'index_page' => 'index.php',
- 'base_url' => 'http://example.com/',
- 'subclass_prefix' => 'MY_'
+ 'base_url' => 'http://example.com/',
+ 'subclass_prefix' => 'MY_',
+ 'enable_query_strings' => FALSE,
+ 'permitted_uri_chars' => 'a-z 0-9~%.:_\-'
));
$this->config = new $cls;
+ if ($this->config->item('enable_query_strings') !== TRUE OR is_cli())
+ {
+ $this->_permitted_uri_chars = $this->config->item('permitted_uri_chars');
+ }
}
- protected function _is_cli_request()
+ public function _set_permitted_uri_chars($value)
{
- return FALSE;
+ $this->_permitted_uri_chars = $value;
}
} \ No newline at end of file
diff --git a/tests/mocks/core/utf8.php b/tests/mocks/core/utf8.php
index 068e74ac1..a43138fbc 100644
--- a/tests/mocks/core/utf8.php
+++ b/tests/mocks/core/utf8.php
@@ -23,4 +23,9 @@ class Mock_Core_Utf8 extends CI_Utf8 {
}
}
+ public function is_ascii_test($str)
+ {
+ return $this->_is_ascii($str);
+ }
+
} \ No newline at end of file