getUser() public method

get the user
Since: 3.0.0
public getUser ( string $key = null ) : mixed
$key string key of the user
return mixed
示例#1
0
 /**
  * adminPanelNotification
  *
  * @since 3.0.0
  *
  * return array
  */
 public static function adminPanelNotification()
 {
     $auth = new Auth(Request::getInstance());
     $auth->init();
     /* demo user */
     if ($auth->getUser('user') === 'demo') {
         self::setNotification('success', Language::get('logged_in') . Language::get('point'));
     }
     return self::getNotification();
 }
示例#2
0
 /**
  * testGetUserInvalid
  *
  * @since 3.0.0
  */
 public function testGetUserInvalid()
 {
     /* setup */
     $auth = new Auth($this->_request);
     $auth->login(1);
     /* actual */
     $actual = $auth->getUser('invalidKey');
     /* compare */
     $this->assertFalse($actual);
 }