mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Реорганизована выдача JWT токенов
Добавлен механизм сохранения сессий и refresh_token
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace tests\codeception\api\traits;
|
||||
|
||||
use api\models\AccountIdentity;
|
||||
use api\traits\AccountFinder;
|
||||
use Codeception\Specify;
|
||||
use common\models\Account;
|
||||
@ -32,6 +33,19 @@ class AccountFinderTest extends DbTestCase {
|
||||
expect($account->id)->equals($this->accounts['admin']['id']);
|
||||
});
|
||||
|
||||
$this->specify('founded account for passed login data with changed account model class name', function() {
|
||||
/** @var AccountFinderTestTestClass $model */
|
||||
$model = new class extends AccountFinderTestTestClass {
|
||||
protected function getAccountClassName() {
|
||||
return AccountIdentity::class;
|
||||
}
|
||||
};
|
||||
$model->login = $this->accounts['admin']['email'];
|
||||
$account = $model->getAccount();
|
||||
expect($account)->isInstanceOf(AccountIdentity::class);
|
||||
expect($account->id)->equals($this->accounts['admin']['id']);
|
||||
});
|
||||
|
||||
$this->specify('null, if account not founded', function() {
|
||||
$model = new AccountFinderTestTestClass();
|
||||
$model->login = 'unexpected';
|
||||
|
Reference in New Issue
Block a user