本文整理汇总了PHP中Drupal\simpletest\WebTestBase::prepareSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP WebTestBase::prepareSettings方法的具体用法?PHP WebTestBase::prepareSettings怎么用?PHP WebTestBase::prepareSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\simpletest\WebTestBase
的用法示例。
在下文中一共展示了WebTestBase::prepareSettings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareSettings
/**
* Add settings that are missed since the installer isn't run.
*/
protected function prepareSettings()
{
parent::prepareSettings();
// Remember the profile which was used.
$settings['settings']['install_profile'] = (object) ['value' => $this->installProfile, 'required' => TRUE];
// Generate a hash salt.
$settings['settings']['hash_salt'] = (object) ['value' => Crypt::randomBytesBase64(55), 'required' => TRUE];
// Since the installer isn't run, add the database settings here too.
$settings['databases']['default'] = (object) ['value' => Database::getConnectionInfo(), 'required' => TRUE];
$this->writeSettings($settings);
}