示例#1
0
 /**
  * 判断用户是否是管理员
  * @param $userName
  */
 public function isAdmin($userName)
 {
     $adminConfig = \Util_Config::getConfig('admin');
     if ($userName == $adminConfig->administrator->name) {
         return true;
     }
     return false;
 }
示例#2
0
 public function testGetConfig()
 {
     $config = Util_Config::getConfig('admin');
     $this->assertEquals(['administrator' => ['name' => 'admin', 'pwd' => 'admin']], $config->toArray());
     $this->assertEquals('admin', $config->administrator->name);
 }