Test fix attempt #185 (#188)

thanks to @Eseperio
This commit is contained in:
Lorenzo Milesi
2018-05-28 08:43:31 +02:00
committed by GitHub
parent 71f9587374
commit fef5f88712

View File

@ -16,10 +16,8 @@ class RegistrationCest
public function _after(FunctionalTester $I) public function _after(FunctionalTester $I)
{ {
\Yii::$container->set(Module::className(), [ Yii::$app->getModule('user')->enableEmailConfirmation = true;
'enableEmailConfirmation' => true, Yii::$app->getModule('user')->generatePasswords = true;
'generatePasswords' => false,
]);
} }
/** /**
@ -29,10 +27,8 @@ class RegistrationCest
*/ */
public function testRegistration(FunctionalTester $I) public function testRegistration(FunctionalTester $I)
{ {
\Yii::$container->set(Module::className(), [ Yii::$app->getModule('user')->enableEmailConfirmation = false;
'enableEmailConfirmation' => false, Yii::$app->getModule('user')->generatePasswords = false;
'generatePasswords' => false,
]);
$I->amOnRoute('/user/registration/register'); $I->amOnRoute('/user/registration/register');
@ -68,9 +64,7 @@ class RegistrationCest
*/ */
public function testRegistrationWithConfirmation(FunctionalTester $I) public function testRegistrationWithConfirmation(FunctionalTester $I)
{ {
\Yii::$container->set(Module::className(), [ Yii::$app->getModule('user')->enableEmailConfirmation = true;
'enableEmailConfirmation' => true,
]);
$I->amOnRoute('/user/registration/register'); $I->amOnRoute('/user/registration/register');
$this->register($I, 'tester@example.com', 'tester', 'tester'); $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'); $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) public function testRegistrationWithoutPassword(FunctionalTester $I)
{ {
\Yii::$container->set(Module::className(), [ Yii::$app->getModule('user')->enableEmailConfirmation = false;
'enableEmailConfirmation' => false, Yii::$app->getModule('user')->generatePasswords = true;
'generatePasswords' => true,
]);
$I->amOnRoute('/user/registration/register'); $I->amOnRoute('/user/registration/register');
$this->register($I, 'tester@example.com', 'tester'); $this->register($I, 'tester@example.com', 'tester');
$I->see('Your account has been created'); $I->see('Your account has been created');