function setUp() { $ctl = new Ethna_Controller(); $ctl->setClientEncoding('EUC-JP'); $ctl->setActionForm(new Ethna_ActionForm($ctl)); $this->local_ctl = $ctl; $plugin = $ctl->getPlugin(); $this->vld = $plugin->getPlugin('Validator', 'Strmincompat'); }
/** * @test */ function setClientEncoding() { $this->controller->setClientEncoding('Shift_JIS'); $this->assertEquals('Shift_JIS', $this->controller->getClientEncoding()); }
function _test_smarty_modifier_wordwrap_i18n($expected, $input_str, $width, $break = "\n", $indent = 0) { unset($GLOBALS['_Ethna_controller']); $ctl = new Ethna_Controller(); $actual = smarty_modifier_wordwrap_i18n($input_str, $width, $break, $indent); $this->assertEqual($expected, $actual); unset($GLOBALS['_Ethna_controller']); // SJIS $ctl = new Ethna_Controller(); $ctl->setClientEncoding('SJIS'); $sjis_input = mb_convert_encoding($input_str, 'SJIS', 'UTF-8'); $sjis_expected = mb_convert_encoding($expected, 'SJIS', 'UTF-8'); $sjis_actual = smarty_modifier_wordwrap_i18n($sjis_input, $width, $break, $indent); $this->assertEqual($sjis_expected, $sjis_actual); unset($GLOBALS['_Ethna_controller']); // EUC-JP $ctl = new Ethna_Controller(); $ctl->setClientEncoding('EUC-JP'); $eucjp_input = mb_convert_encoding($input_str, 'EUC-JP', 'UTF-8'); $eucjp_expected = mb_convert_encoding($expected, 'EUC-JP', 'UTF-8'); $eucjp_actual = smarty_modifier_wordwrap_i18n($eucjp_input, $width, $break, $indent); $this->assertEqual($eucjp_expected, $eucjp_actual); }