本文整理匯總了PHP中TestController::go方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestController::go方法的具體用法?PHP TestController::go怎麽用?PHP TestController::go使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TestController
的用法示例。
在下文中一共展示了TestController::go方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCacheKeyNoRequestParams
/**
* Test cache key, no params
* @TODO Possibly load the resulting markup as a DOM object and test various children in it; this would enforce valid markup
*/
function testCacheKeyNoRequestParams()
{
$config = Config::getInstance();
$config->setValue('cache_pages', true);
$controller = new TestController(true);
$results = $controller->go();
$this->assertEqual($controller->getCacheKeyString(), '');
}
示例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']);
}