示例#1
0
 function realtyCommercialsDelete()
 {
     $adminToken = file_get_contents(codecept_data_dir('admin_token.json'));
     $realtyCommercialsID = file_get_contents(codecept_data_dir('realtyCommercialId.json'));
     $this->restModule->haveHttpHeader('token', $adminToken);
     $this->restModule->haveHttpHeader('Content-Type', 'application/json');
     $this->restModule->sendDELETE('/realties/' . $realtyCommercialsID . '/delete');
     $realtyCommercialDelete = $this->restModule->grabResponse();
     $this->debugSection('realtyCommercialDelete', $realtyCommercialDelete);
     $this->restModule->seeResponseCodeIS(200);
     $this->restModule->seeResponseIsJson();
     $this->restModule->seeHttpHeader('Content-Type', 'application/json');
 }
示例#2
0
 public function testSeeHeaders()
 {
     $response = new \Symfony\Component\BrowserKit\Response("", 200, ['Cache-Control' => ['no-cache', 'no-store'], 'Content_Language' => 'en-US']);
     $this->module->client->mockResponse($response);
     $this->module->sendGET('/');
     $this->module->seeHttpHeader('Cache-Control');
     $this->module->seeHttpHeader('content_language', 'en-US');
     $this->module->seeHttpHeader('Content-Language', 'en-US');
     $this->module->dontSeeHttpHeader('Content-Language', 'en-RU');
     $this->module->dontSeeHttpHeader('Content-Language1');
     $this->module->seeHttpHeaderOnce('Content-Language');
     $this->assertEquals('en-US', $this->module->grabHttpHeader('Content-Language'));
     $this->assertEquals('no-cache', $this->module->grabHttpHeader('Cache-Control'));
     $this->assertEquals(['no-cache', 'no-store'], $this->module->grabHttpHeader('Cache-Control', false));
 }