當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TestController::getViewManager方法代碼示例

本文整理匯總了PHP中TestController::getViewManager方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestController::getViewManager方法的具體用法?PHP TestController::getViewManager怎麽用?PHP TestController::getViewManager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TestController的用法示例。


在下文中一共展示了TestController::getViewManager方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testControl

 /**
  * Test controller
  * @TODO Possibly load the resulting markup as a DOM object and test various children in it; this would enforce valid markup
  */
 function testControl()
 {
     $config = Config::getInstance();
     $controller = new TestController(true);
     $results = $controller->go();
     //test if view variables were set correctly
     $v_mgr = $controller->getViewManager();
     $this->assertEqual($v_mgr->getTemplateDataItem('test'), 'Testing, testing, 123');
     $this->assertEqual($v_mgr->getTemplateDataItem('app_title'), 'ThinkTank');
     $this->assertEqual($results, '<a href="' . $config->getValue('site_root_path') . 'index.php">ThinkTank</a>: Testing, testing, 123 | Not logged in', "controller output");
 }
開發者ID:prop7,項目名稱:thinktank,代碼行數:15,代碼來源:TestOfTestController.php

示例2: testExceptionHandling

 /**
  * Test exception handling
  */
 public function testExceptionHandling()
 {
     $_GET['throwexception'] = 'yesindeedy';
     $controller = new TestController(true);
     $results = $controller->go();
     $v_mgr = $controller->getViewManager();
     $config = Config::getInstance();
     $this->assertEqual('Testing exception handling!', $v_mgr->getTemplateDataItem('error_msg'));
     $this->assertPattern('/<html/', $results);
     $_GET['json'] = true;
     $results = $controller->go();
     $this->debug($results);
     $this->assertFalse(strpos($results, '<html'));
     $this->assertPattern('/{/', $results);
     $this->assertPattern('/Testing exception handling/', $results);
     $this->assertEqual('Exception', $v_mgr->getTemplateDataItem('error_type'));
     unset($_GET['json']);
     $_GET['text'] = true;
     $results = $controller->go();
     $this->assertFalse(strpos($results, '<html'));
     $this->assertFalse(strpos($results, '{'));
     $this->assertPattern('/Testing exception handling/', $results);
     $this->assertEqual('Exception', $v_mgr->getTemplateDataItem('error_type'));
     unset($_GET['text']);
 }
開發者ID:pepeleproso,項目名稱:ThinkUp,代碼行數:28,代碼來源:TestOfTestController.php


注:本文中的TestController::getViewManager方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。