Реорганизован процесс авторизации для функциональных тестов

This commit is contained in:
ErickSkrauch
2017-01-24 02:00:08 +03:00
parent 4695b6e724
commit fbaf48591f
21 changed files with 44 additions and 52 deletions

View File

@@ -17,7 +17,7 @@ class TwoFactorAuthEnableCest {
}
public function testFails(FunctionalTester $I) {
$I->loggedInAsActiveAccount('AccountWithOtpSecret', 'password_0');
$I->amAuthenticated('AccountWithOtpSecret');
$this->route->enable();
$I->canSeeResponseContainsJson([
@@ -37,7 +37,7 @@ class TwoFactorAuthEnableCest {
],
]);
$I->loggedInAsActiveAccount('AccountWithEnabledOtp', 'password_0');
$I->amAuthenticated('AccountWithEnabledOtp');
$this->route->enable('123456', 'invalid_password');
$I->canSeeResponseContainsJson([
'success' => false,
@@ -48,7 +48,7 @@ class TwoFactorAuthEnableCest {
}
public function testSuccessEnable(FunctionalTester $I) {
$I->loggedInAsActiveAccount('AccountWithOtpSecret', 'password_0');
$I->amAuthenticated('AccountWithOtpSecret');
$totp = new TOTP(null, 'some otp secret value');
$this->route->enable($totp->now(), 'password_0');
$I->canSeeResponseCodeIs(200);