mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 13:02:24 +08:00
Fix #18269: Fix integer safe attribute to work properly in yii\base\Model
This commit is contained in:
committed by
GitHub
parent
b680494d6b
commit
e348c0f460
@ -175,6 +175,18 @@ class ModelTest extends TestCase
|
||||
$this->assertTrue($speaker->isAttributeSafe('firstName'));
|
||||
}
|
||||
|
||||
public function testIsAttributeSafeForIntegerAttribute()
|
||||
{
|
||||
$model = new RulesModel();
|
||||
$model->rules = [
|
||||
[
|
||||
[123456], 'safe',
|
||||
]
|
||||
];
|
||||
|
||||
$this->assertTrue($model->isAttributeSafe(123456));
|
||||
}
|
||||
|
||||
public function testSafeScenarios()
|
||||
{
|
||||
$model = new RulesModel();
|
||||
|
||||
Reference in New Issue
Block a user