mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Allow augmentation of test session state
Useful e.g. to add a 'stubfile' path in a custom feature context.
This commit is contained in:
parent
fc6d1ac12b
commit
d4006b9735
@ -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',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user