mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 15:05:32 +00: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');
|
$url = $this->joinUrlParts($this->getBaseUrl(), '/dev/testsession/start');
|
||||||
$params = array(
|
$url .= '?' . http_build_query($this->getTestSessionState());
|
||||||
'database' => $this->databaseName,
|
|
||||||
'mailer' => 'SilverStripe\BehatExtension\Utility\TestMailer',
|
|
||||||
);
|
|
||||||
$url .= '?' . http_build_query($params);
|
|
||||||
|
|
||||||
$this->getSession()->visit($url);
|
$this->getSession()->visit($url);
|
||||||
|
|
||||||
$page = $this->getSession()->getPage();
|
$page = $this->getSession()->getPage();
|
||||||
@ -162,7 +157,18 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
|
|||||||
}
|
}
|
||||||
|
|
||||||
$loginForm = $page->find('css', '#MemberLoginForm_LoginForm');
|
$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…
x
Reference in New Issue
Block a user