コード例 #1
0
ファイル: RestTest.php プロジェクト: pfz/codeception
 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
ファイル: RestTest.php プロジェクト: corcre/elabftw
 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']]);
 }
コード例 #3
0
 /**
  * @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]]);
 }