<?php $I = new SeleniumTester($scenario); $I->am('a guest'); $I->wantTo('be redirect to login, cause I have wrong cookie'); $I->setCookie('password', 'ofcousethisisawrongcookie'); $I->amOnPage('/password'); $I->seeCurrentUrlEquals('/password/login');
<?php $I = new SeleniumTester($scenario); $I->am('a guest'); $I->wantTo('Ensure cannot change password if cookie not correct'); $I->setCookie('password', 'thewrongpassword'); $I->amOnPage('/password'); $I->sendPOST('http://manhgiay.dev/password/updatePassword', ['password' => 'password']); $I->seeCurrentUrlEquals('/password/login');
<?php $I = new SeleniumTester($scenario); $I->am('a guest'); $I->wantTo('make sure no one could log out if not having correct cookie'); $I->setCookie('password', 'anotherwrongcookie'); $I->amOnPage('/password'); $I->sendPOST('http://manhgiay.dev/password/logOut'); $I->seeCurrentUrlEquals('/password/login'); $I->resetCookie('password'); $I->sendPOST('http://manhgiay.dev/password/logOut'); $I->seeCurrentUrlEquals('/password/login');
<?php $I = new SeleniumTester($scenario); $I->am('a guest'); $I->wantTo('guarantee no one can remove password if not having correct cookie'); $I->amOnPage('/password'); $I->setCookie('password', 'yetAnotherWrongCookie'); $I->sendPOST('http://manhgiay.dev/password/removePassword'); $I->seeCurrentUrlEquals('/password/login'); $I->resetCookie('password'); $I->sendPOST('http://manhgiay.dev/password/removePassword'); $I->seeCurrentUrlEquals('/password/login');