2016-05-17 01:39:44 +05:30
|
|
|
<?php
|
|
|
|
namespace tests\codeception\api\functional;
|
|
|
|
|
|
|
|
use tests\codeception\api\_pages\AccountsRoute;
|
|
|
|
use tests\codeception\api\FunctionalTester;
|
2017-09-19 22:36:16 +05:30
|
|
|
use tests\codeception\common\helpers\Mock;
|
|
|
|
use yii\validators\EmailValidator;
|
2016-05-17 01:39:44 +05:30
|
|
|
|
|
|
|
class AccountsChangeEmailSubmitNewEmailCest {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var AccountsRoute
|
|
|
|
*/
|
|
|
|
private $route;
|
|
|
|
|
|
|
|
public function _before(FunctionalTester $I) {
|
|
|
|
$this->route = new AccountsRoute($I);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testSubmitNewEmail(FunctionalTester $I) {
|
2017-09-19 22:36:16 +05:30
|
|
|
Mock::func(EmailValidator::class, 'checkdnsrr')->andReturnTrue();
|
|
|
|
|
2016-05-17 01:39:44 +05:30
|
|
|
$I->wantTo('submit new email');
|
2017-09-19 22:36:16 +05:30
|
|
|
$id = $I->amAuthenticated('ILLIMUNATI');
|
2016-05-17 01:39:44 +05:30
|
|
|
|
2017-09-19 22:36:16 +05:30
|
|
|
$this->route->changeEmailSubmitNewEmail($id, 'H27HBDCHHAG2HGHGHS', 'my-new-email@ely.by');
|
2016-05-17 01:39:44 +05:30
|
|
|
$I->canSeeResponseCodeIs(200);
|
|
|
|
$I->canSeeResponseIsJson();
|
|
|
|
$I->canSeeResponseContainsJson([
|
|
|
|
'success' => true,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|