本文整理汇总了PHP中App\services\Config::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::set方法的具体用法?PHP Config::set怎么用?PHP Config::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\services\Config
的用法示例。
在下文中一共展示了Config::set方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testHandleRegister
public function testHandleRegister()
{
$code = $this->addCode();
// test wrong code
$this->post('/auth/register', []);
$this->assertEquals('200', $this->response->getStatusCode());
$this->checkErrorCode(AuthController::WrongCode);
// test illegal email
$this->post('/auth/register', ["code" => $code]);
$this->assertEquals('200', $this->response->getStatusCode());
$this->checkErrorCode(AuthController::IllegalEmail);
// test password to short
$shortPwd = '123';
$this->post('/auth/register', ["code" => $code, "email" => $this->email, "passwd" => $shortPwd]);
$this->assertEquals('200', $this->response->getStatusCode());
$this->checkErrorCode(AuthController::PasswordTooShort);
// test password not equal
$this->post('/auth/register', ["code" => $code, "email" => $this->email, "passwd" => $this->password, "repasswd" => $shortPwd]);
$this->assertEquals('200', $this->response->getStatusCode());
$this->checkErrorCode(AuthController::PasswordNotEqual);
// test email used
$this->post('/auth/register', ["code" => $code, "email" => $this->getExistEmail(), "passwd" => $this->password, "repasswd" => $this->password]);
$this->assertEquals('200', $this->response->getStatusCode());
$this->checkErrorCode(AuthController::EmailUsed);
// illegal register
Config::set('emailVerifyEnabled', false);
$this->post('/auth/register', ["code" => $code, "email" => $this->email, "passwd" => $this->password, "repasswd" => $this->password, "name" => "name"]);
$this->assertEquals('200', $this->response->getStatusCode());
}
示例2: testHash
public function testHash()
{
Config::set('pwdMethod', 'md5');
$this->hashTest();
Config::set('pwdMethod', 'sha256');
$this->hashTest();
Config::set('pwdMethod', 'default');
$this->hashTest();
}
示例3: TestingCache
public function TestingCache($cache)
{
fwrite(STDERR, "test {$cache} cache ");
Config::set('cache', $cache);
$client = Factory::newCache();
$key = 'key';
$value = 'value';
$ttl = 3600;
$client->set($key, $value, $ttl);
$this->assertEquals($value, $client->get($key));
$client->del($key);
$this->assertEquals(null, $client->get($key));
// test expired
$ttl = 1;
$client->set($key, $value, $ttl);
sleep(2);
$this->assertEquals(null, $client->get($key));
// test wrong key
$this->assertEquals(null, $client->get(time()));
}
示例4: setTestingEnv
/**
* Set testing env
*/
public function setTestingEnv()
{
Config::set('env', 'testing');
}
示例5: setMuKey
protected function setMuKey()
{
Config::set('muKey', $this->muKey);
}
示例6: testSendDailyMail
public function testSendDailyMail()
{
Config::set('mailDriver', 'file');
DailyMail::sendDailyMail();
}