Skip to content

Commit 0a5b71f

Browse files
committed
Add test.
1 parent 9ebb903 commit 0a5b71f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/framework/widgets/ActiveFieldTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
1111
use Yii;
1212
use yii\base\DynamicModel;
13+
use yii\base\InvalidConfigException;
1314
use yii\web\AssetManager;
1415
use yii\web\View;
1516
use yii\widgets\ActiveField;
@@ -691,6 +692,16 @@ public function testInputOptionsTransferToWidget()
691692
'options' => ['placeholder' => 'pholder_both_direct']
692693
]);
693694
$this->assertStringContainsString('placeholder="pholder_both_direct"', (string) $widget);
695+
696+
try {
697+
$widget = $this->activeField->widget(TestMaskedInput::className(), [
698+
'clientOptions' => [
699+
'regex' => '^.*$',
700+
],
701+
]);
702+
} catch (InvalidConfigException $exception) {
703+
$this->fail($exception->getMessage());
704+
}
694705
}
695706

696707
/**

0 commit comments

Comments
 (0)