mirror of
https://github.com/elyby/accounts.git
synced 2024-12-28 16:10:40 +05:30
e67257b8aa
Добавлена базовая форма с запросом пароля Валидация ника и email адреса вынесены из формы регистрации в модель аккаунта Отрефакторен тест формы регистрации Добавлены тесты для модели аккаунта
34 lines
971 B
PHP
34 lines
971 B
PHP
<?php
|
|
namespace tests\codeception\api\_pages;
|
|
|
|
use yii\codeception\BasePage;
|
|
|
|
/**
|
|
* @property \tests\codeception\api\FunctionalTester $actor
|
|
*/
|
|
class AccountsRoute extends BasePage {
|
|
|
|
public function current() {
|
|
$this->route = ['accounts/current'];
|
|
$this->actor->sendGET($this->getUrl());
|
|
}
|
|
|
|
public function changePassword($currentPassword = null, $newPassword = null, $newRePassword = null) {
|
|
$this->route = ['accounts/change-password'];
|
|
$this->actor->sendPOST($this->getUrl(), [
|
|
'password' => $currentPassword,
|
|
'newPassword' => $newPassword,
|
|
'newRePassword' => $newRePassword,
|
|
]);
|
|
}
|
|
|
|
public function changeUsername($currentPassword = null, $newUsername = null) {
|
|
$this->route = ['accounts/change-username'];
|
|
$this->actor->sendPOST($this->getUrl(), [
|
|
'password' => $currentPassword,
|
|
'username' => $newUsername,
|
|
]);
|
|
}
|
|
|
|
}
|