本文整理汇总了PHP中Redaxscript\Db::setSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::setSetting方法的具体用法?PHP Db::setSetting怎么用?PHP Db::setSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redaxscript\Db
的用法示例。
在下文中一共展示了Db::setSetting方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _set
/**
* set the setting
*
* @since 3.0.0
*
* @param array $optionArray
*
* @return boolean
*/
protected function _set($optionArray = [])
{
$key = $this->prompt('key', $optionArray);
$value = $this->prompt('value', $optionArray);
if ($key && $value) {
return Db::setSetting($key, $value);
}
return false;
}
示例2: tearDownAfterClass
/**
* tearDownAfterClass
*
* @since 3.0.0
*/
public static function tearDownAfterClass()
{
Db::setSetting('captcha', 0);
Db::setSetting('notification', 0);
}
示例3: testMailFailure
/**
* testMailFailure
*
* @since 3.0.0
*
* @param array $postArray
* @param array $hashArray
* @param array $settingArray
* @param string $expect
*
* @dataProvider providerMailFailure
*/
public function testMailFailure($postArray = [], $hashArray = [], $settingArray = [], $expect = null)
{
/* setup */
Db::setSetting('notification', $settingArray['notification']);
Db::setSetting('moderation', $settingArray['moderation']);
$this->_request->set('post', $postArray);
$this->_request->setPost('solution', function_exists('password_verify') ? $hashArray[0] : $hashArray[1]);
$stub = $this->getMockBuilder('Redaxscript\\Controller\\Comment')->setConstructorArgs([$this->_registry, $this->_language, $this->_request])->setMethods(['_mail'])->getMock();
/* override */
$stub->expects($this->any())->method('_mail')->will($this->returnValue(false));
/* actual */
$actual = $stub->process();
/* compare */
$this->assertEquals($expect, $actual);
}
示例4: tearDownAfterClass
/**
* tearDownAfterClass
*
* @since 3.0.0
*/
public static function tearDownAfterClass()
{
Db::setSetting('captcha', 0);
Db::forTablePrefix('users')->whereIdIs(1)->findOne()->set('password', 'test')->save();
}
示例5: testGetAndSetSetting
/**
* testGetAndSetSetting
*
* @since 2.2.0
*/
public function testGetAndSetSetting()
{
/* setup */
Db::setSetting('charset', 'utf-8');
/* actual */
$actual = Db::getSetting('charset');
/* compare */
$this->assertEquals('utf-8', $actual);
}
示例6: testProcess
/**
* testProcess
*
* @since 3.0.0
*
* @param array $postArray
* @param array $hashArray
* @param array $settingArray
* @param string $expect
*
* @dataProvider providerProcess
*/
public function testProcess($postArray = [], $hashArray = [], $settingArray = [], $expect = null)
{
/* setup */
Db::setSetting('notification', $settingArray['notification']);
Db::setSetting('moderation', $settingArray['moderation']);
$this->_request->set('post', $postArray);
$this->_request->setPost('solution', function_exists('password_verify') ? $hashArray[0] : $hashArray[1]);
$commentController = new Controller\Comment($this->_registry, $this->_language, $this->_request);
/* actual */
$actual = $commentController->process();
/* compare */
$this->assertEquals($expect, $actual);
}