mirror of
https://github.com/elyby/accounts.git
synced 2024-10-30 15:33:21 +05:30
27 lines
725 B
PHP
27 lines
725 B
PHP
<?php
|
|
namespace codeception\api\unit\models\profile;
|
|
|
|
use api\models\profile\ChangeLanguageForm;
|
|
use common\models\Account;
|
|
use tests\codeception\api\unit\TestCase;
|
|
use tests\codeception\common\fixtures\AccountFixture;
|
|
|
|
class ChangeLanguageFormTest extends TestCase {
|
|
|
|
public function _fixtures() {
|
|
return [
|
|
'accounts' => AccountFixture::class
|
|
];
|
|
}
|
|
|
|
public function testApplyLanguage() {
|
|
/** @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);
|
|
}
|
|
|
|
}
|