Merge pull request #164 from kinglozzer/logout-token

Add logout form step
This commit is contained in:
Daniel Hensby 2017-06-21 12:15:15 +01:00 committed by GitHub
commit 28a5b52695
1 changed files with 11 additions and 1 deletions

View File

@ -57,7 +57,7 @@ class LoginContext implements Context
public function stepIAmNotLoggedIn()
{
$c = $this->getMainContext();
$this->getMainContext()->getSession()->visit($c->joinUrlParts($c->getBaseUrl(), 'Security/logout'));
$this->getMainContext()->getSession()->visit($c->joinUrlParts($c->getBaseUrl(), Security::logout_url()));
}
/**
@ -107,6 +107,16 @@ class LoginContext implements Context
assertNotNull($loginForm, 'I should see a log-in form');
}
/**
* @Given /^I should see a log-out form$/
*/
public function stepIShouldSeeALogOutForm()
{
$page = $this->getMainContext()->getSession()->getPage();
$logoutForm = $page->find('css', '#LogoutForm_Form');
assertNotNull($logoutForm, 'I should see a log-out form');
}
/**
* @Then /^I will see a "([^"]*)" log-in message$/
* @param string $type