public function actionSignup() { $model = new SignupForm($this->module->defaultRole); if ($model->load(Yii::$app->request->post())) { if ($user = $model->signup()) { Yii::$app->getSession()->setFlash('success', Module::t('module', 'FLASH_EMAIL_CONFIRM_REQUEST')); return $this->goHome(); } } return $this->render('signup', ['model' => $model]); }
public function testNotCorrectSignup() { $model = new SignupForm('user', ['username' => 'admin', 'email' => '*****@*****.**', 'password' => 'some_password', 'verifyCode' => 'testme']); expect('username and email are in use, user should not be created', $model->signup())->null(); }