2017-01-21 04:24:30 +05:30
|
|
|
<?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) {
|
2017-09-19 22:36:16 +05:30
|
|
|
$accountId = $I->amAuthenticated();
|
|
|
|
$this->route->credentials($accountId);
|
2017-01-21 04:24:30 +05:30
|
|
|
$I->canSeeResponseCodeIs(200);
|
|
|
|
$I->canSeeResponseIsJson();
|
|
|
|
$I->canSeeResponseJsonMatchesJsonPath('$.secret');
|
|
|
|
$I->canSeeResponseJsonMatchesJsonPath('$.uri');
|
|
|
|
$I->canSeeResponseJsonMatchesJsonPath('$.qr');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|