示例#1
0
 public function testPut()
 {
     $this->module->sendPUT('/rest/user/', array('name' => 'laura'));
     $this->module->seeResponseContains('*****@*****.**');
     $this->module->seeResponseContainsJson(array('name' => 'laura'));
     $this->module->dontSeeResponseContainsJson(array('name' => 'john'));
 }
示例#2
0
 public function testDontSeeInJson()
 {
     $this->module->response = '{"ticket": {"title": "Bug should be fixed", "user": {"name": "Davert"}}}';
     $this->module->seeResponseIsJson();
     $this->module->dontSeeResponseContainsJson(['name' => 'Davet']);
     $this->module->dontSeeResponseContainsJson(['user' => ['name' => 'Davet']]);
     $this->module->dontSeeResponseContainsJson(['user' => ['title' => 'Bug should be fixed']]);
 }
 /**
  * @Issue https://github.com/Codeception/Codeception/issues/2070
  */
 public function testArrayOfZeroesInJsonResponse()
 {
     $this->module->haveHttpHeader('Content-Type', 'application/json');
     $this->module->sendGET('/rest/zeroes');
     $this->module->dontSeeResponseContainsJson(['responseCode' => 0, 'data' => [0, 0, 0]]);
 }