summaryrefslogtreecommitdiffstats
path: root/tests/mocks/core/utf8.php
diff options
context:
space:
mode:
authorAnton Lindqvist <anton@qvister.se>2012-06-08 10:09:47 +0200
committerAnton Lindqvist <anton@qvister.se>2012-06-08 10:09:47 +0200
commit94c6b1f1c02466178c1f8e144542d753f27dd3d8 (patch)
tree8e8ca4b8383e2481b0a689fd07fc230013531822 /tests/mocks/core/utf8.php
parent6581cac4d2b5fef69478ce1a5c3464200bfcbba5 (diff)
parentc78e56a7df140ee777ffc67687877f3e70c77e28 (diff)
Merge branch 'develop' of https://github.com/EllisLab/CodeIgniter into develop
Conflicts: system/libraries/Cache/Cache.php
Diffstat (limited to 'tests/mocks/core/utf8.php')
-rw-r--r--tests/mocks/core/utf8.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/mocks/core/utf8.php b/tests/mocks/core/utf8.php
new file mode 100644
index 000000000..b77d717e7
--- /dev/null
+++ b/tests/mocks/core/utf8.php
@@ -0,0 +1,27 @@
+<?php
+
+class Mock_Core_Utf8 extends CI_Utf8 {
+
+ /**
+ * We need to define several constants as
+ * the same process within CI_Utf8 class constructor.
+ *
+ * @covers CI_Utf8::__construct()
+ */
+ public function __construct()
+ {
+ defined('UTF8_ENABLED') or define('UTF8_ENABLED', TRUE);
+
+ if (extension_loaded('mbstring'))
+ {
+ defined('MB_ENABLED') or define('MB_ENABLED', TRUE);
+ mb_internal_encoding('UTF-8');
+ }
+ else
+ {
+ defined('MB_ENABLED') or define('MB_ENABLED', FALSE);
+ }
+
+ }
+
+} \ No newline at end of file