mirror of
https://github.com/elyby/accounts.git
synced 2024-10-30 15:33:21 +05:30
3b9ef7ea70
Добавлен валидатор для TOTP кодов
29 lines
756 B
PHP
29 lines
756 B
PHP
<?php
|
|
namespace tests\codeception\api\functional;
|
|
|
|
use tests\codeception\api\_pages\TwoFactorAuthRoute;
|
|
use tests\codeception\api\FunctionalTester;
|
|
|
|
class TwoFactorAuthCredentialsCest {
|
|
|
|
/**
|
|
* @var TwoFactorAuthRoute
|
|
*/
|
|
private $route;
|
|
|
|
public function _before(FunctionalTester $I) {
|
|
$this->route = new TwoFactorAuthRoute($I);
|
|
}
|
|
|
|
public function testGetCredentials(FunctionalTester $I) {
|
|
$I->loggedInAsActiveAccount();
|
|
$this->route->credentials();
|
|
$I->canSeeResponseCodeIs(200);
|
|
$I->canSeeResponseIsJson();
|
|
$I->canSeeResponseJsonMatchesJsonPath('$.secret');
|
|
$I->canSeeResponseJsonMatchesJsonPath('$.uri');
|
|
$I->canSeeResponseJsonMatchesJsonPath('$.qr');
|
|
}
|
|
|
|
}
|