From 684608a241a542c82f1af4bd7b97b7fda77eb9e7 Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Wed, 21 Jun 2017 11:52:07 +0100 Subject: [PATCH] Add logout form step --- src/Context/LoginContext.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Context/LoginContext.php b/src/Context/LoginContext.php index 900c148..dcf3f65 100644 --- a/src/Context/LoginContext.php +++ b/src/Context/LoginContext.php @@ -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