mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Add logout form step
This commit is contained in:
parent
3d2e742709
commit
684608a241
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user