mirror of
https://github.com/elyby/accounts.git
synced 2024-10-31 07:53:02 +05:30
27 lines
819 B
PHP
27 lines
819 B
PHP
<?php
|
|
namespace codeception\api\unit\models\profile;
|
|
|
|
use api\models\profile\AcceptRulesForm;
|
|
use common\models\Account;
|
|
use tests\codeception\api\unit\TestCase;
|
|
use tests\codeception\common\fixtures\AccountFixture;
|
|
use const common\LATEST_RULES_VERSION;
|
|
|
|
class AcceptRulesFormTest extends TestCase {
|
|
|
|
public function _fixtures() {
|
|
return [
|
|
'accounts' => AccountFixture::class,
|
|
];
|
|
}
|
|
|
|
public function testAgreeWithLatestRules() {
|
|
/** @var Account $account */
|
|
$account = Account::findOne($this->tester->grabFixture('accounts', 'account-with-old-rules-version'));
|
|
$model = new AcceptRulesForm($account);
|
|
$this->assertTrue($model->agreeWithLatestRules());
|
|
$this->assertEquals(LATEST_RULES_VERSION, $account->rules_agreement_version);
|
|
}
|
|
|
|
}
|