2016-05-19 03:40:05 +05:30
|
|
|
<?php
|
2017-10-01 05:59:00 +05:30
|
|
|
namespace tests\codeception\api\functional\accounts;
|
2016-05-19 03:40:05 +05:30
|
|
|
|
|
|
|
use tests\codeception\api\_pages\AccountsRoute;
|
|
|
|
use tests\codeception\api\FunctionalTester;
|
|
|
|
|
2017-10-01 05:59:00 +05:30
|
|
|
class ChangeLangCest {
|
2016-05-19 03:40:05 +05:30
|
|
|
|
|
|
|
/**
|
|
|
|
* @var AccountsRoute
|
|
|
|
*/
|
|
|
|
private $route;
|
|
|
|
|
|
|
|
public function _before(FunctionalTester $I) {
|
|
|
|
$this->route = new AccountsRoute($I);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testSubmitNewEmail(FunctionalTester $I) {
|
|
|
|
$I->wantTo('change my account language');
|
2017-09-19 22:36:16 +05:30
|
|
|
$id = $I->amAuthenticated();
|
2016-05-19 03:40:05 +05:30
|
|
|
|
2017-09-19 22:36:16 +05:30
|
|
|
$this->route->changeLanguage($id, 'ru');
|
2016-05-19 03:40:05 +05:30
|
|
|
$I->canSeeResponseCodeIs(200);
|
|
|
|
$I->canSeeResponseIsJson();
|
|
|
|
$I->canSeeResponseContainsJson([
|
|
|
|
'success' => true,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|