summaryrefslogtreecommitdiffstats
path: root/tests/mocks/core/utf8.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-05-16 14:08:24 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-05-16 14:08:24 +0200
commit8279420f989a8cda4427c3983ee919c6a1073dd7 (patch)
tree77921a510be4a02d3408c259a20af14a67c41d04 /tests/mocks/core/utf8.php
parentf4f9f787082e45c04a8d007450d9151f5a068732 (diff)
parent14455e57770112bf8cd938980925ded12f3cba9e (diff)
Merge pull request #1360 from toopay/core-tests
Unit tests for Benchmark, Input and Security classes.
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