[BridgeImplementationTest] Add test for "required" attribute on lists and checkboxes
Lists and checkboxes don't support the "required" flag and should not define it. Note that the "required" flag can be set to false if so desired.
This commit is contained in:
parent
434c12672f
commit
d532d0e0c4
1 changed files with 13 additions and 0 deletions
|
@ -98,6 +98,19 @@ class BridgeImplementationTest extends TestCase {
|
|||
|
||||
if (isset($options['required'])) {
|
||||
$this->assertInternalType('bool', $options['required'], $field . ': invalid required');
|
||||
|
||||
if($options['required'] === true && isset($options['type'])) {
|
||||
switch($options['type']) {
|
||||
case 'list':
|
||||
case 'checkbox':
|
||||
$this->assertArrayNotHasKey(
|
||||
'required',
|
||||
$options,
|
||||
$field . ': "required" attribute not supported for ' . $options['type']
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($options['title'])) {
|
||||
|
|
Loading…
Reference in a new issue