1
0
mirror of https://github.com/chylex/Lightning-Tracker.git synced 2024-11-24 22:42:50 +01:00
Lightning-Tracker/tests/acceptance/T003_AdminLogout_Cest.php

45 lines
874 B
PHP

<?php
declare(strict_types = 1);
namespace acceptance;
use AcceptanceTester;
class T003_AdminLogout_Cest{
private function tryUseToken(AcceptanceTester $I): void{
$I->amLoggedIn('Admin');
$I->amOnPage('/account');
}
public function logout(AcceptanceTester $I): void{
$this->tryUseToken($I);
$I->submitForm('#Logout', []);
$I->seeCookie('logon', [
'value' => '',
'expires' => null,
]);
$I->seeCurrentUrlEquals('/');
}
/**
* @depends logout
*/
public function cannotReuseToken(AcceptanceTester $I): void{
$this->tryUseToken($I);
$I->seeCurrentUrlEquals('/login?return=account');
}
/**
* @depends cannotReuseToken
*/
public function loginAgain(AcceptanceTester $I): void{
$login = new T002_AdminLogin_Cest();
$login->_before($I);
$login->login($I);
}
}
?>