summaryrefslogtreecommitdiffstats
path: root/tests/mocks/core/utf8.php
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2012-05-17 14:02:21 +0200
committerTimothy Warren <tim@timshomepage.net>2012-05-17 14:02:21 +0200
commite8e09039b49ac5883e9e94162579841375e13c69 (patch)
treec206119bbc5bdcd573b56609b6450b14e6c20dcb /tests/mocks/core/utf8.php
parent43c216b998ccf8c8208b237e9e0d9c468c8a82e5 (diff)
parentae31eb5e75d914fc3ab622a7ac5c23eb1e6d9f9a (diff)
Merge upstream
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