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