Esempio n. 1
0
 /**
  * Finds user by [[username]]
  *
  * @return User|null
  */
 public function getUser()
 {
     if ($this->_user === false) {
         $this->_user = User::findByUsername($this->username);
     }
     return $this->_user;
 }
Esempio n. 2
0
 public function setUp()
 {
     parent::setUp();
     Yii::$app->user->login(User::findByUsername('root'));
 }