summaryrefslogtreecommitdiffstats
path: root/tests/mocks/core/utf8.php
diff options
context:
space:
mode:
authorTaufan Aditya <toopay@taufanaditya.com>2012-05-15 18:57:05 +0200
committerTaufan Aditya <toopay@taufanaditya.com>2012-05-15 18:57:05 +0200
commit7756af5df0a53930019e9fd7b828504f0c2c5427 (patch)
tree9e21ffb6c4b14ebb193105f10c8e2ad47d63176b /tests/mocks/core/utf8.php
parentd40a545e9e7e4dc222d58fe46fe23f3691f043ee (diff)
Input class code-coverage
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