Beispiel #1
0
 public function testSetCookieByHeader()
 {
     $this->module->amOnPage('/cookies2');
     $this->module->seeResponseCodeIs(200);
     $this->module->seeCookie('a');
     $this->assertEquals('b', $this->module->grabCookie('a'));
 }
 /**
  * @issue https://github.com/Codeception/Codeception/issues/2234
  */
 public function testEmptyValueOfCookie()
 {
     //set cookie
     $this->module->amOnPage('/cookies2');
     $this->module->amOnPage('/unset-cookie');
     $this->module->seeResponseCodeIs(200);
     $this->module->dontSeeCookie('a');
 }
 public function testHttpAuth()
 {
     $this->module->amOnPage('/auth');
     $this->module->seeResponseCodeIs(401);
     $this->module->see('Unauthorized');
     $this->module->amHttpAuthenticated('davert', 'password');
     $this->module->amOnPage('/auth');
     $this->module->dontSee('Unauthorized');
     $this->module->see("Welcome, davert");
     $this->module->amHttpAuthenticated('davert', '123456');
     $this->module->amOnPage('/auth');
     $this->module->see('Forbidden');
 }