parameters = $parameters; $this->useContext('db', new DbContext($parameters)); } /** * @Given /^I am logged in as "([^"]*)" with password "([^"]*)"$/ */ public function iAmLoggedInAsWithPassword($username, $password, $remember=false) { $this->fillField('Username', $username); $this->fillField('Password', $password); if ($remember) { $this->checkOption('user_remember'); } $this->pressButton('log in'); } /** * @Given /^I am logged in as "([^"]*)" with password "([^"]*)" with remember me$/ */ public function iAmLoggedInAsWithPasswordWithRememberMe($username, $password) { $session_name = $this->getSubcontext('db')->getSessionName($this->parameters); $this->iAmLoggedInAsWithPassword($username, $password, true); $this->getMink()->assertSession()->cookieExists($session_name); $this->getMink()->assertSession()->cookieExists('dc_admin'); } /** * @When /^I restart my browser$/ */ public function iRestartMyBrowser() { $session_name = $this->getSubcontext('db')->getSessionName($this->parameters); $this->getMink()->assertSession()->cookieExists($session_name); } /** * @When /^I switch to blog "([^"]*)"$/ */ public function iSwitchToBlog($blog_name) { $this->selectOption('switchblog', $blog_name); $this->pressButton('ok'); } }