2016-02-24 01:34:01 +03:00
|
|
|
<?php
|
|
|
|
namespace tests\codeception\api\_pages;
|
|
|
|
|
|
|
|
use yii\codeception\BasePage;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property \tests\codeception\api\FunctionalTester $actor
|
|
|
|
*/
|
2016-02-26 01:45:21 +03:00
|
|
|
class AccountsRoute extends BasePage {
|
2016-02-24 01:34:01 +03:00
|
|
|
|
|
|
|
public function current() {
|
2016-02-27 01:22:09 +03:00
|
|
|
$this->route = ['accounts/current'];
|
2016-02-24 01:34:01 +03:00
|
|
|
$this->actor->sendGET($this->getUrl());
|
|
|
|
}
|
|
|
|
|
2016-02-27 01:22:09 +03:00
|
|
|
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,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2016-03-20 02:25:26 +03:00
|
|
|
public function changeUsername($currentPassword = null, $newUsername = null) {
|
|
|
|
$this->route = ['accounts/change-username'];
|
|
|
|
$this->actor->sendPOST($this->getUrl(), [
|
|
|
|
'password' => $currentPassword,
|
|
|
|
'username' => $newUsername,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2016-05-23 21:27:09 +03:00
|
|
|
public function changeEmailInitialize($password = '') {
|
2016-05-16 11:21:12 +03:00
|
|
|
$this->route = ['accounts/change-email-initialize'];
|
2016-05-23 21:27:09 +03:00
|
|
|
$this->actor->sendPOST($this->getUrl(), [
|
|
|
|
'password' => $password,
|
|
|
|
]);
|
2016-05-16 11:21:12 +03:00
|
|
|
}
|
|
|
|
|
2016-05-16 23:09:44 +03:00
|
|
|
public function changeEmailSubmitNewEmail($key = null, $email = null) {
|
|
|
|
$this->route = ['accounts/change-email-submit-new-email'];
|
|
|
|
$this->actor->sendPOST($this->getUrl(), [
|
|
|
|
'key' => $key,
|
|
|
|
'email' => $email,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function changeEmailConfirmNewEmail($key = null) {
|
|
|
|
$this->route = ['accounts/change-email-confirm-new-email'];
|
|
|
|
$this->actor->sendPOST($this->getUrl(), [
|
|
|
|
'key' => $key,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2016-05-19 01:10:05 +03:00
|
|
|
public function changeLang($lang = null) {
|
|
|
|
$this->route = ['accounts/change-lang'];
|
|
|
|
$this->actor->sendPOST($this->getUrl(), [
|
|
|
|
'lang' => $lang,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2016-02-24 01:34:01 +03:00
|
|
|
}
|