mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Дописаны недостающие тесты для форм смены E-mail адреса
This commit is contained in:
@ -35,4 +35,19 @@ class AccountsRoute extends BasePage {
|
||||
$this->actor->sendPOST($this->getUrl());
|
||||
}
|
||||
|
||||
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,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace tests\codeception\api\functional;
|
||||
|
||||
use Codeception\Specify;
|
||||
use tests\codeception\api\_pages\AccountsRoute;
|
||||
use tests\codeception\api\FunctionalTester;
|
||||
|
||||
class AccountsChangeEmailConfirmNewEmailCest {
|
||||
|
||||
/**
|
||||
* @var AccountsRoute
|
||||
*/
|
||||
private $route;
|
||||
|
||||
public function _before(FunctionalTester $I) {
|
||||
$this->route = new AccountsRoute($I);
|
||||
}
|
||||
|
||||
public function testConfirmNewEmail(FunctionalTester $I) {
|
||||
$I->wantTo('change my email and get changed value');
|
||||
$I->loggedInAsActiveAccount('CrafterGameplays', 'password_0');
|
||||
|
||||
$this->route->changeEmailConfirmNewEmail('H28HBDCHHAG2HGHGHS');
|
||||
$I->canSeeResponseCodeIs(200);
|
||||
$I->canSeeResponseIsJson();
|
||||
$I->canSeeResponseContainsJson([
|
||||
'success' => true,
|
||||
'data' => [
|
||||
'email' => 'my-new-email@ely.by',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace tests\codeception\api\functional;
|
||||
|
||||
use Codeception\Specify;
|
||||
use tests\codeception\api\_pages\AccountsRoute;
|
||||
use tests\codeception\api\FunctionalTester;
|
||||
|
||||
class AccountsChangeEmailSubmitNewEmailCest {
|
||||
|
||||
/**
|
||||
* @var AccountsRoute
|
||||
*/
|
||||
private $route;
|
||||
|
||||
public function _before(FunctionalTester $I) {
|
||||
$this->route = new AccountsRoute($I);
|
||||
}
|
||||
|
||||
public function testSubmitNewEmail(FunctionalTester $I) {
|
||||
$I->wantTo('submit new email');
|
||||
$I->loggedInAsActiveAccount('ILLIMUNATI', 'password_0');
|
||||
|
||||
$this->route->changeEmailSubmitNewEmail('H27HBDCHHAG2HGHGHS', 'my-new-email@ely.by');
|
||||
$I->canSeeResponseCodeIs(200);
|
||||
$I->canSeeResponseIsJson();
|
||||
$I->canSeeResponseContainsJson([
|
||||
'success' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user