accounts/tests/codeception/api/unit/models/profile/ChangeLanguageFormTest.php
2016-10-29 00:47:31 +03:00

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);
}
}