當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Config::set方法代碼示例

本文整理匯總了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());
 }
開發者ID:SharkIng,項目名稱:ss-panel,代碼行數:29,代碼來源:AuthTest.php

示例2: testHash

 public function testHash()
 {
     Config::set('pwdMethod', 'md5');
     $this->hashTest();
     Config::set('pwdMethod', 'sha256');
     $this->hashTest();
     Config::set('pwdMethod', 'default');
     $this->hashTest();
 }
開發者ID:SharkIng,項目名稱:ss-panel,代碼行數:9,代碼來源:HashTest.php

示例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()));
 }
開發者ID:SharkIng,項目名稱:ss-panel,代碼行數:20,代碼來源:CacheTest.php

示例4: setTestingEnv

 /**
  * Set testing env
  */
 public function setTestingEnv()
 {
     Config::set('env', 'testing');
 }
開發者ID:SharkIng,項目名稱:ss-panel,代碼行數:7,代碼來源:TestCase.php

示例5: setMuKey

 protected function setMuKey()
 {
     Config::set('muKey', $this->muKey);
 }
開發者ID:SharkIng,項目名稱:ss-panel,代碼行數:4,代碼來源:MuTest.php

示例6: testSendDailyMail

 public function testSendDailyMail()
 {
     Config::set('mailDriver', 'file');
     DailyMail::sendDailyMail();
 }
開發者ID:SharkIng,項目名稱:ss-panel,代碼行數:5,代碼來源:SendDailyMailTest.php


注:本文中的App\services\Config::set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。