Skip to content

Commit

Permalink
Update active field options test.
Browse files Browse the repository at this point in the history
  • Loading branch information
alxlnk committed Jul 4, 2024
1 parent c9b425e commit cc038bd
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/framework/widgets/ActiveFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,13 @@ public function testInputOptionsTransferToWidget()
]);
$this->assertStringContainsString('placeholder="pholder_direct"', (string) $widget);

// use regex clientOptions instead mask
$widget = $this->activeField->widget(TestMaskedInput::className(), [
'options' => ['placeholder' => 'pholder_direct'],
'clientOptions' => ['regex' => '^.*$'],
]);
$this->assertStringContainsString('placeholder="pholder_direct"', (string) $widget);

// transfer options from ActiveField to widget
$this->activeField->inputOptions = ['placeholder' => 'pholder_input'];
$widget = $this->activeField->widget(TestMaskedInput::className(), [
Expand All @@ -692,16 +699,6 @@ public function testInputOptionsTransferToWidget()
'options' => ['placeholder' => 'pholder_both_direct']
]);
$this->assertStringContainsString('placeholder="pholder_both_direct"', (string) $widget);

try {
$widget = $this->activeField->widget(TestMaskedInput::className(), [
'clientOptions' => [
'regex' => '^.*$',
],
]);
} catch (InvalidConfigException $exception) {
$this->fail($exception->getMessage());
}
}

/**
Expand Down

0 comments on commit cc038bd

Please sign in to comment.