Skip to content

Commit 32688de

Browse files
committed
Update active field options test.
1 parent c9b425e commit 32688de

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

tests/framework/widgets/ActiveFieldTest.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
1111
use Yii;
1212
use yii\base\DynamicModel;
13-
use yii\base\InvalidConfigException;
1413
use yii\web\AssetManager;
1514
use yii\web\View;
1615
use yii\widgets\ActiveField;
@@ -678,6 +677,13 @@ public function testInputOptionsTransferToWidget()
678677
]);
679678
$this->assertStringContainsString('placeholder="pholder_direct"', (string) $widget);
680679

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+
681687
// transfer options from ActiveField to widget
682688
$this->activeField->inputOptions = ['placeholder' => 'pholder_input'];
683689
$widget = $this->activeField->widget(TestMaskedInput::className(), [
@@ -692,16 +698,6 @@ public function testInputOptionsTransferToWidget()
692698
'options' => ['placeholder' => 'pholder_both_direct']
693699
]);
694700
$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-
}
705701
}
706702

707703
/**

0 commit comments

Comments
 (0)