Exemplo n.º 1
0
 public function testNotFoundView()
 {
     $controller = new Ethna_Controller_Dummy();
     $form = new Ethna_ActionForm_Dummy($controller);
     $controller->setActionForm($form);
     $backend = $controller->getBackend();
     $backend->setActionForm($form);
     $view = new Ethna_View_500($backend, "dummy", "");
     ob_start();
     @$view->preforward();
     @$view->forward();
     $content = ob_get_clean();
     $this->assertEquals("error500.tpl", $controller->getRenderer()->templates[0]);
 }
Exemplo n.º 2
0
 public function testNotFoundView()
 {
     $controller = new Ethna_Controller_Dummy();
     $form = new Ethna_ActionForm_Dummy($controller);
     $controller->setActionForm($form);
     $backend = $controller->getBackend();
     $backend->setActionForm($form);
     $view = new Ethna_View_Redirect($backend, "redirect", "");
     ob_start();
     @$view->preforward("http://example.com/");
     @$view->forward();
     $content = ob_get_clean();
     // MEMO(chobie):今のだとむりぽ!とりあえず出力結果がなければOKとしておこう
     $this->assertEquals($content, "");
 }
Exemplo n.º 3
0
 function test_preforward_non_utf8()
 {
     $controller = new Ethna_Controller_Dummy();
     $form = new Ethna_ActionForm_Dummy($controller);
     $controller->setActionForm($form);
     $backend = $controller->getBackend();
     $backend->setActionForm($form);
     $view = new Ethna_View_Json($backend, "dummy", "");
     $controller->setClientEncoding('EUC-JP');
     ob_start();
     $param = array("a", "あいうえ");
     mb_convert_variables('EUC-JP', 'UTF-8', $param);
     @$view->preforward($param);
     @$view->forward();
     $content = ob_get_clean();
     $this->assertEquals($content, '["a","\\u3042\\u3044\\u3046\\u3048"]');
 }