2016-05-19 01:10:05 +03:00
|
|
|
<?php
|
2019-02-20 22:58:52 +03:00
|
|
|
namespace api\tests\functional\accounts;
|
2016-05-19 01:10:05 +03:00
|
|
|
|
2019-02-20 22:58:52 +03:00
|
|
|
use api\tests\_pages\AccountsRoute;
|
|
|
|
use api\tests\FunctionalTester;
|
2016-05-19 01:10:05 +03:00
|
|
|
|
2017-10-01 03:29:00 +03:00
|
|
|
class ChangeLangCest {
|
2016-05-19 01:10:05 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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 20:06:16 +03:00
|
|
|
$id = $I->amAuthenticated();
|
2016-05-19 01:10:05 +03:00
|
|
|
|
2017-09-19 20:06:16 +03:00
|
|
|
$this->route->changeLanguage($id, 'ru');
|
2016-05-19 01:10:05 +03:00
|
|
|
$I->canSeeResponseCodeIs(200);
|
|
|
|
$I->canSeeResponseIsJson();
|
|
|
|
$I->canSeeResponseContainsJson([
|
|
|
|
'success' => true,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|