mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Добавлено поле версии принятых правил
This commit is contained in:
@@ -8,6 +8,7 @@ use tests\codeception\common\fixtures\AccountFixture;
|
||||
use tests\codeception\common\fixtures\MojangUsernameFixture;
|
||||
use tests\codeception\common\unit\DbTestCase;
|
||||
use Yii;
|
||||
use const common\LATEST_RULES_VERSION;
|
||||
|
||||
/**
|
||||
* @property array $accounts
|
||||
@@ -176,4 +177,29 @@ class AccountTest extends DbTestCase {
|
||||
});
|
||||
}
|
||||
|
||||
public function testGetProfileLink() {
|
||||
$model = new Account();
|
||||
$model->id = '123';
|
||||
$this->assertEquals('http://ely.by/u123', $model->getProfileLink());
|
||||
}
|
||||
|
||||
public function testIsAgreedWithActualRules() {
|
||||
$this->specify('get false, if rules field set in null', function() {
|
||||
$model = new Account();
|
||||
expect($model->isAgreedWithActualRules())->false();
|
||||
});
|
||||
|
||||
$this->specify('get false, if rules field have version less, then actual', function() {
|
||||
$model = new Account();
|
||||
$model->rules_agreement_version = 0;
|
||||
expect($model->isAgreedWithActualRules())->false();
|
||||
});
|
||||
|
||||
$this->specify('get true, if rules field have equals rules version', function() {
|
||||
$model = new Account();
|
||||
$model->rules_agreement_version = LATEST_RULES_VERSION;
|
||||
expect($model->isAgreedWithActualRules())->true();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user