示例#1
0
 /**
  * Returns the actual user object behind the context.
  *
  * @return User The user object behind the context
  */
 public function getContextUser()
 {
     if (!isset($this->user)) {
         $this->user = User::fromConfig($this->invokeGet('SHOW_USER_CONFIG'), $this);
     }
     return $this->user;
 }
示例#2
0
 /**
  * @depends testImpersonate
  * @expectedException \Omines\DirectAdmin\DirectAdminException
  * @expectedExceptionMessage Unknown user type 'invalid'
  */
 public function testInvalidUserType(UserContext $context)
 {
     User::fromConfig(['username' => 'invalid', 'usertype' => 'invalid'], $context);
 }