예제 #1
0
 public function testGet() {
     $this->module->sendGET('/rest/user/');
     $this->module->seeResponseIsJson();
     $this->module->seeResponseContains('davert');
     $this->module->seeResponseContainsJson(array('name' => 'davert'));
     $this->module->seeResponseCodeIs(200);
     $this->module->dontSeeResponseCodeIs(404);
 }
예제 #2
0
 /**
  * @Issue https://github.com/Codeception/Codeception/issues/2075
  * Client is undefined for the second test
  */
 public function testTwoTests()
 {
     $cest1 = Stub::makeEmpty('\\Codeception\\TestCase\\Cest');
     $cest2 = Stub::makeEmpty('\\Codeception\\TestCase\\Cest');
     $this->module->sendGET('/rest/user/');
     $this->module->seeResponseIsJson();
     $this->module->seeResponseContains('davert');
     $this->module->seeResponseContainsJson(array('name' => 'davert'));
     $this->module->seeResponseCodeIs(200);
     $this->module->dontSeeResponseCodeIs(404);
     $this->phpBrowser->_after($cest1);
     $this->module->_after($cest1);
     $this->module->_before($cest2);
     $this->phpBrowser->_before($cest2);
     $this->module->sendGET('/rest/user/');
     $this->module->seeResponseIsJson();
     $this->module->seeResponseContains('davert');
     $this->module->seeResponseContainsJson(array('name' => 'davert'));
     $this->module->seeResponseCodeIs(200);
     $this->module->dontSeeResponseCodeIs(404);
 }