我正在使用Symfony 1.4
使用phpunit功能测试
<?php
include(dirname(__FILE__).'/../../bootstrap/functional.php');
$browser = new sfTestFunctional(new sfBrowser());
$browser->
get('/api/v2/membership/membershipDetails')->
with('request')->begin()->
isParameter('module', 'api')->
isParameter('action', 'apiRequest')->
end()->
with('response')->begin()->
isStatusCode(200)->
end()
;
预计会提供类似
的输出ok 1 - request parameter module is api
ok 2 - request parameter action is apiRequest
ok 3 - status code is 200
1..3
# Looks like everything went fine.
但是我的代码将API响应作为输出 -
# get /api/v2/membership/membershipDetails
{"responseStatusCode":"1","responseMessage":"Something went wrong. Please try again later.","AUTHCHECKSUM":null,"hamburgerDetails":null,"phoneDetails":null}
# Looks like everything went fine.
我尝试更改一些symfony文件并找到了 -
lib/vendor/symfony/utils/sfBrowser.class.php<br>
line #44 - $this->context->getController()->dispatch();
在此线路工作之前回声死亡,但在此线路回声模块不工作之后
SomeWhere die用于此功能,我无法找到。请帮忙。