Add logout form step

This commit is contained in:
Loz Calver 2017-06-21 11:52:07 +01:00
parent 3d2e742709
commit 684608a241
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