summaryrefslogtreecommitdiffstats
path: root/tests/Bootstrap.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-02-12 18:25:01 +0100
committerAndrey Andreev <narf@devilix.net>2014-02-12 18:25:01 +0100
commiteb555ed7a1673dab9f51df0d1365d19c4429a900 (patch)
treeae46cd92af686b5f356c9515989c28aa8e8f59b7 /tests/Bootstrap.php
parentbfbdf1eb200c89783b98a6d6b23de3483fbc8975 (diff)
Move mbstring/iconv configuration and MB_ENABLED, ICONV_ENABLED out of CI_Utf8::__construct()
Also, use mb_substitute_character() instead of ini_set()
Diffstat (limited to 'tests/Bootstrap.php')
-rw-r--r--tests/Bootstrap.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php
index c98d88531..7f10ea1d6 100644
--- a/tests/Bootstrap.php
+++ b/tests/Bootstrap.php
@@ -40,6 +40,29 @@ isset($_SERVER['REMOTE_ADDR']) OR $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
// Prep our test environment
include_once $dir.'/mocks/core/common.php';
include_once SYSTEM_PATH.'core/Common.php';
+
+
+if (extension_loaded('mbstring'))
+{
+ defined('MB_ENABLED') OR define('MB_ENABLED', TRUE);
+ mb_internal_encoding('UTF-8');
+ mb_substitute_character('none');
+}
+else
+{
+ defined('MB_ENABLED') OR define('MB_ENABLED', FALSE);
+}
+
+if (extension_loaded('iconv'))
+{
+ defined('ICONV_ENABLED') OR define('ICONV_ENABLED', TRUE);
+ iconv_set_encoding('internal_encoding', 'UTF-8');
+}
+else
+{
+ defined('ICONV_ENABLED') OR define('ICONV_ENABLED', FALSE);
+}
+
include_once $dir.'/mocks/autoloader.php';
spl_autoload_register('autoload');