mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Import DB and fixtures as a separate step
Usually triggered by manual test session environment runs
This commit is contained in:
parent
7f4b5dd19b
commit
41cdc87eae
@ -130,7 +130,25 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
|
||||
);
|
||||
}
|
||||
|
||||
$this->testSessionEnvironment->startTestSession($this->getTestSessionState());
|
||||
$state = $this->getTestSessionState();
|
||||
$this->testSessionEnvironment->startTestSession($state);
|
||||
|
||||
// Optionally import database
|
||||
if(!empty($state['importDatabasePath'])) {
|
||||
$this->testSessionEnvironment->importDatabase(
|
||||
$state['importDatabasePath'],
|
||||
!empty($state['requireDefaultRecords']) ? $state['requireDefaultRecords'] : false
|
||||
);
|
||||
} else if(!empty($state['requireDefaultRecords']) && $state['requireDefaultRecords']) {
|
||||
$this->testSessionEnvironment->requireDefaultRecords();
|
||||
}
|
||||
|
||||
// Fixtures
|
||||
$fixtureFile = (!empty($params['fixture'])) ? $params['fixture'] : null;
|
||||
if($fixtureFile) {
|
||||
$this->testSessionEnvironment->loadFixtureIntoDb($fixtureFile);
|
||||
}
|
||||
|
||||
|
||||
if($screenSize = getenv('BEHAT_SCREEN_SIZE')) {
|
||||
list($screenWidth, $screenHeight) = explode('x', $screenSize);
|
||||
|
Loading…
Reference in New Issue
Block a user