2016-05-16 23:09:44 +03:00
|
|
|
<?php
|
2019-02-20 22:58:52 +03:00
|
|
|
namespace api\tests\functional\accounts;
|
2016-05-16 23:09:44 +03:00
|
|
|
|
2019-02-20 22:58:52 +03:00
|
|
|
use api\tests\_pages\AccountsRoute;
|
|
|
|
use api\tests\FunctionalTester;
|
2016-05-16 23:09:44 +03:00
|
|
|
|
2017-10-01 03:29:00 +03:00
|
|
|
class ChangeEmailConfirmNewEmailCest {
|
2016-05-16 23:09:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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');
|
2017-01-24 02:00:08 +03:00
|
|
|
$I->amAuthenticated('CrafterGameplays');
|
2016-05-16 23:09:44 +03:00
|
|
|
|
2017-09-19 20:06:16 +03:00
|
|
|
$this->route->changeEmail(8, 'H28HBDCHHAG2HGHGHS');
|
2016-05-16 23:09:44 +03:00
|
|
|
$I->canSeeResponseCodeIs(200);
|
|
|
|
$I->canSeeResponseIsJson();
|
|
|
|
$I->canSeeResponseContainsJson([
|
|
|
|
'success' => true,
|
|
|
|
'data' => [
|
|
|
|
'email' => 'my-new-email@ely.by',
|
|
|
|
],
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|