Удалена зависимость от yiisoft/yii2-codeception в пользу интегрированного в Codeception генератора REST адресов

Реорганизованы объекты Pages для Functional тестов
Исправлены не переименованные тесты, оставшиеся после последнего рефакторинга
This commit is contained in:
ErickSkrauch
2017-10-01 03:24:23 +03:00
parent f51bfcb20d
commit 0dbbb2e0de
20 changed files with 101 additions and 205 deletions

View File

@@ -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,
]);
}