/** * @param string $username * @param string $email * @param string $password * @return User * @throws \yii\base\Exception * @throws \yii\base\InvalidConfigException * @throws \yii\db\Exception */ private function insertUser($username = '******', $email = '*****@*****.**', $password = '******') { $user = new User(['username' => $username, 'email' => $email, 'password' => $password]); $user->activateAndSave(); return $user; }