From fef5f887129360234a75bc22e1ab364b8f4c89f1 Mon Sep 17 00:00:00 2001 From: Lorenzo Milesi Date: Mon, 28 May 2018 08:43:31 +0200 Subject: [PATCH] Test fix attempt #185 (#188) thanks to @Eseperio --- tests/functional/RegistrationCest.php | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/tests/functional/RegistrationCest.php b/tests/functional/RegistrationCest.php index dfc19cf..903d446 100644 --- a/tests/functional/RegistrationCest.php +++ b/tests/functional/RegistrationCest.php @@ -16,10 +16,8 @@ class RegistrationCest public function _after(FunctionalTester $I) { - \Yii::$container->set(Module::className(), [ - 'enableEmailConfirmation' => true, - 'generatePasswords' => false, - ]); + Yii::$app->getModule('user')->enableEmailConfirmation = true; + Yii::$app->getModule('user')->generatePasswords = true; } /** @@ -29,10 +27,8 @@ class RegistrationCest */ public function testRegistration(FunctionalTester $I) { - \Yii::$container->set(Module::className(), [ - 'enableEmailConfirmation' => false, - 'generatePasswords' => false, - ]); + Yii::$app->getModule('user')->enableEmailConfirmation = false; + Yii::$app->getModule('user')->generatePasswords = false; $I->amOnRoute('/user/registration/register'); @@ -68,9 +64,7 @@ class RegistrationCest */ public function testRegistrationWithConfirmation(FunctionalTester $I) { - \Yii::$container->set(Module::className(), [ - 'enableEmailConfirmation' => true, - ]); + Yii::$app->getModule('user')->enableEmailConfirmation = true; $I->amOnRoute('/user/registration/register'); $this->register($I, 'tester@example.com', 'tester', 'tester'); $I->see('Your account has been created and a message with further instructions has been sent to your email'); @@ -90,10 +84,8 @@ class RegistrationCest */ public function testRegistrationWithoutPassword(FunctionalTester $I) { - \Yii::$container->set(Module::className(), [ - 'enableEmailConfirmation' => false, - 'generatePasswords' => true, - ]); + Yii::$app->getModule('user')->enableEmailConfirmation = false; + Yii::$app->getModule('user')->generatePasswords = true; $I->amOnRoute('/user/registration/register'); $this->register($I, 'tester@example.com', 'tester'); $I->see('Your account has been created');