我用fiddler向服务器发送请求,它发送响应
Fiddler url: http://api.demo.loc/lc/
header:User-Agent: Fiddler
Host: api.demo.loc
Content-Type: application/x-www-form-urlencoded
Content-Length: 49
Request body: m=stt&l=2&n=5&news_version=2我想用共同欺骗来检查这个
I wrote config like this:
class_name: ApiGuy
modules:
enabled: [PhpBrowser, REST, ApiHelper]
config:
PhpBrowser:
url: http://api.demo.loc/lc/
REST:
url: http://api.demo.loc/lc/
And my code:
<?php
$I = new ApiGuy($scenario);
$I->wantTo('STEP 1');
$I->haveHttpHeader('User-Agent: Codeception', 'Host: api.demo.loc');
$I->haveHttpHeader('Content-Type: application/x-www-form-urlencoded','Content-Length: 49');
// get a succesful response
$I->sendPOST('', array('m' => 'stt','l' => '2', 'n' => '5', 'news_version' => '2'));
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson(array('result' => 'success'));
?>线路seeResponseContainsJson错误
发布于 2014-12-10 16:10:23
如果你用--debug这样运行它会怎么样?它是否提供了出错原因的任何细节?
codecept.phar run --debughttps://stackoverflow.com/questions/26420330
复制相似问题