当前位置: 首页>>代码示例>>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;未经允许,请勿转载。