【发布时间】:2017-01-26 16:13:44
【问题描述】:
我们正在考虑将我们的 API 集成测试转移到 CakePHP 的 PHPUnit 版本。我们需要测试 API 的返回值是否正常(有效的 JSON 等...)
IntegrationTestCase 抽象类上的辅助方法看起来非常有用,允许我通过简单地调用$this->get('/articles') 或类似方法来模拟请求,但据我所知,没有办法实际读取对这些请求之一的响应。我错过了什么吗?
似乎如果没有 IntegrationTestCase 提供的辅助方法,发出请求会更加困难。那么我最好的选择是什么?
【问题讨论】:
-
$this->_sendJson($response);
标签: cakephp phpunit integration-testing