10
10
use DMS \PHPUnitExtensions \ArraySubset \ArraySubsetAsserts ;
11
11
use Yii ;
12
12
use yii \base \DynamicModel ;
13
- use yii \base \InvalidConfigException ;
14
13
use yii \web \AssetManager ;
15
14
use yii \web \View ;
16
15
use yii \widgets \ActiveField ;
@@ -678,6 +677,13 @@ public function testInputOptionsTransferToWidget()
678
677
]);
679
678
$ this ->assertStringContainsString ('placeholder="pholder_direct" ' , (string ) $ widget );
680
679
680
+ // use regex clientOptions instead mask
681
+ $ widget = $ this ->activeField ->widget (TestMaskedInput::className (), [
682
+ 'options ' => ['placeholder ' => 'pholder_direct ' ],
683
+ 'clientOptions ' => ['regex ' => '^.*$ ' ],
684
+ ]);
685
+ $ this ->assertStringContainsString ('placeholder="pholder_direct" ' , (string ) $ widget );
686
+
681
687
// transfer options from ActiveField to widget
682
688
$ this ->activeField ->inputOptions = ['placeholder ' => 'pholder_input ' ];
683
689
$ widget = $ this ->activeField ->widget (TestMaskedInput::className (), [
@@ -692,16 +698,6 @@ public function testInputOptionsTransferToWidget()
692
698
'options ' => ['placeholder ' => 'pholder_both_direct ' ]
693
699
]);
694
700
$ 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
- }
705
701
}
706
702
707
703
/**
0 commit comments