Allow augmentation of test session state

Useful e.g. to add a 'stubfile' path in a custom feature context.
This commit is contained in:
Ingo Schommer 2013-11-27 19:32:14 +01:00
parent fc6d1ac12b
commit d4006b9735

View File

@ -142,12 +142,7 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
}
$url = $this->joinUrlParts($this->getBaseUrl(), '/dev/testsession/start');
$params = array(
'database' => $this->databaseName,
'mailer' => 'SilverStripe\BehatExtension\Utility\TestMailer',
);
$url .= '?' . http_build_query($params);
$url .= '?' . http_build_query($this->getTestSessionState());
$this->getSession()->visit($url);
$page = $this->getSession()->getPage();
@ -162,7 +157,18 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
}
$loginForm = $page->find('css', '#MemberLoginForm_LoginForm');
}
/**
* Returns a parameter map of state to set within the test session.
*
* @return array
*/
public function getTestSessionState() {
return array(
'database' => $this->databaseName,
'mailer' => 'SilverStripe\BehatExtension\Utility\TestMailer',
);
}
/**