mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Удалена зависимость от yiisoft/yii2-codeception в пользу интегрированного в Codeception генератора REST адресов
Реорганизованы объекты Pages для Functional тестов Исправлены не переименованные тесты, оставшиеся после последнего рефакторинга
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
<?php
|
||||
namespace tests\codeception\api\_pages;
|
||||
|
||||
use yii\codeception\BasePage;
|
||||
|
||||
/**
|
||||
* @property \tests\codeception\api\FunctionalTester $actor
|
||||
*/
|
||||
class AuthenticationRoute extends BasePage {
|
||||
|
||||
/**
|
||||
@@ -15,7 +10,6 @@ class AuthenticationRoute extends BasePage {
|
||||
* @param bool $rememberMe
|
||||
*/
|
||||
public function login($login = '', $password = '', $rememberMeOrToken = null, $rememberMe = false) {
|
||||
$this->route = ['authentication/login'];
|
||||
$params = [
|
||||
'login' => $login,
|
||||
'password' => $password,
|
||||
@@ -27,25 +21,22 @@ class AuthenticationRoute extends BasePage {
|
||||
$params['totp'] = $rememberMeOrToken;
|
||||
}
|
||||
|
||||
$this->actor->sendPOST($this->getUrl(), $params);
|
||||
$this->getActor()->sendPOST('/authentication/login', $params);
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
$this->route = ['authentication/logout'];
|
||||
$this->actor->sendPOST($this->getUrl());
|
||||
$this->getActor()->sendPOST('/authentication/logout');
|
||||
}
|
||||
|
||||
public function forgotPassword($login = null, $token = null) {
|
||||
$this->route = ['authentication/forgot-password'];
|
||||
$this->actor->sendPOST($this->getUrl(), [
|
||||
$this->getActor()->sendPOST('/authentication/forgot-password', [
|
||||
'login' => $login,
|
||||
'totp' => $token,
|
||||
]);
|
||||
}
|
||||
|
||||
public function recoverPassword($key = null, $newPassword = null, $newRePassword = null) {
|
||||
$this->route = ['authentication/recover-password'];
|
||||
$this->actor->sendPOST($this->getUrl(), [
|
||||
$this->getActor()->sendPOST('/authentication/recover-password', [
|
||||
'key' => $key,
|
||||
'newPassword' => $newPassword,
|
||||
'newRePassword' => $newRePassword,
|
||||
@@ -53,8 +44,7 @@ class AuthenticationRoute extends BasePage {
|
||||
}
|
||||
|
||||
public function refreshToken($refreshToken = null) {
|
||||
$this->route = ['authentication/refresh-token'];
|
||||
$this->actor->sendPOST($this->getUrl(), [
|
||||
$this->getActor()->sendPOST('/authentication/refresh-token', [
|
||||
'refresh_token' => $refreshToken,
|
||||
]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user