Taufan Aditya | 7756af5 | 2012-05-15 23:57:05 +0700 | [diff] [blame] | 1 | <?php |
| 2 | |
| 3 | class Mock_Core_Utf8 extends CI_Utf8 { |
| 4 | |
| 5 | /** |
| 6 | * We need to define several constants as |
| 7 | * the same process within CI_Utf8 class constructor. |
| 8 | * |
| 9 | * @covers CI_Utf8::__construct() |
| 10 | */ |
| 11 | public function __construct() |
| 12 | { |
| 13 | defined('UTF8_ENABLED') or define('UTF8_ENABLED', TRUE); |
| 14 | |
| 15 | if (extension_loaded('mbstring')) |
| 16 | { |
| 17 | defined('MB_ENABLED') or define('MB_ENABLED', TRUE); |
| 18 | mb_internal_encoding('UTF-8'); |
| 19 | } |
| 20 | else |
| 21 | { |
| 22 | defined('MB_ENABLED') or define('MB_ENABLED', FALSE); |
| 23 | } |
| 24 | |
| 25 | } |
| 26 | |
| 27 | } |