setup CMS Settings in one test step

This commit is contained in:
Jeffrey Guo 2014-11-13 17:42:14 +13:00 committed by Ingo Schommer
parent 30894eb4cf
commit 4f14175022

View File

@ -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();
}
}