mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
setup CMS Settings in one test step
This commit is contained in:
parent
30894eb4cf
commit
4f14175022
@ -266,4 +266,19 @@ JS;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example Given the CMS settings has the following data
|
||||||
|
* | Title | My site title |
|
||||||
|
* | Theme | My site theme |
|
||||||
|
* @Given /^the CMS settings have the following data$/
|
||||||
|
*/
|
||||||
|
public function theCmsSettingsHasData(TableNode $fieldsTable) {
|
||||||
|
$fields = $fieldsTable->getRowsHash();
|
||||||
|
$siteConfig = \SiteConfig::get()->first();
|
||||||
|
foreach($fields as $field => $value) {
|
||||||
|
$siteConfig->$field = $value;
|
||||||
|
}
|
||||||
|
$siteConfig->write();
|
||||||
|
$siteConfig->flushCache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user