本文整理汇总了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']);
}