diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1047d5003..68effbc94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,5 +91,5 @@ jobs: - name: Apply migration run: php yii_test migrate --interactive=0 - - name: Run tests with codeception + - name: Run tests with codeception run: vendor/bin/codecept run diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 6de678a1e..dacf32977 100644 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -227,7 +227,7 @@ public function actionVerifyEmail($token) } catch (InvalidArgumentException $e) { throw new BadRequestHttpException($e->getMessage()); } - if (($user = $model->verifyEmail()) && Yii::$app->user->login($user)) { + if ($model->verifyEmail()) { Yii::$app->session->setFlash('success', 'Your email has been confirmed!'); return $this->goHome(); } diff --git a/frontend/tests/functional/VerifyEmailCest.php b/frontend/tests/functional/VerifyEmailCest.php index b227426e7..1e457babe 100644 --- a/frontend/tests/functional/VerifyEmailCest.php +++ b/frontend/tests/functional/VerifyEmailCest.php @@ -3,6 +3,7 @@ namespace frontend\tests\functional; use common\fixtures\UserFixture; +use common\models\User; use frontend\tests\FunctionalTester; class VerifyEmailCest @@ -57,12 +58,11 @@ public function checkSuccessVerification(FunctionalTester $I) $I->amOnRoute('site/verify-email', ['token' => '4ch0qbfhvWwkcuWqjN8SWRq72SOw1KYT_1548675330']); $I->canSee('Your email has been confirmed!'); $I->canSee('Congratulations!', 'h1'); - $I->see('Logout (test.test)', 'form button[type=submit]'); - + $I->dontSee('Logout (test.test)', 'form button[type=submit]'); $I->seeRecord('common\models\User', [ - 'username' => 'test.test', - 'email' => 'test@mail.com', - 'status' => \common\models\User::STATUS_ACTIVE + 'username' => 'test.test', + 'email' => 'test@mail.com', + 'status' => User::STATUS_ACTIVE ]); } }