2016-05-19 03:40:05 +05:30
|
|
|
<?php
|
|
|
|
namespace codeception\api\unit\models\profile;
|
|
|
|
|
|
|
|
use api\models\profile\ChangeLanguageForm;
|
|
|
|
use common\models\Account;
|
2016-10-29 03:17:31 +05:30
|
|
|
use tests\codeception\api\unit\TestCase;
|
2016-05-19 03:40:05 +05:30
|
|
|
use tests\codeception\common\fixtures\AccountFixture;
|
|
|
|
|
2016-10-29 03:17:31 +05:30
|
|
|
class ChangeLanguageFormTest extends TestCase {
|
2016-05-19 03:40:05 +05:30
|
|
|
|
2016-10-29 03:17:31 +05:30
|
|
|
public function _fixtures() {
|
2016-05-19 03:40:05 +05:30
|
|
|
return [
|
2016-10-29 03:17:31 +05:30
|
|
|
'accounts' => AccountFixture::class
|
2016-05-19 03:40:05 +05:30
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testApplyLanguage() {
|
2016-10-29 03:17:31 +05:30
|
|
|
/** @var Account $account */
|
|
|
|
$account = $this->tester->grabFixture('accounts', 'admin');
|
|
|
|
$model = new ChangeLanguageForm($account);
|
|
|
|
$model->lang = 'ru';
|
|
|
|
$this->assertTrue($model->applyLanguage());
|
|
|
|
$this->assertEquals('ru', $account->lang);
|
2016-05-19 03:40:05 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
}
|