go()
go(string $url, $params = array()) : array
Parameters
string | $url | 请求的链接 |
$params |
Returns
array —接口的返回结果
PhalApi_Helper_TestRunner - 快速接口执行 - 辅助类
使用示例:
public function testWhatever() {
//Step 1. 构建请求URL
$url = 'service=Default.Index&username=dogstar';
//Step 2. 执行请求
$rs = PhalApi_Helper_TestRunner::go($url);
//Step 3. 验证
$this->assertNotEmpty($rs);
$this->assertArrayHasKey('code', $rs);
$this->assertArrayHasKey('msg', $rs);
}