[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:
logmanoriginal 2019-01-22 18:12:34 +01:00
parent 434c12672f
commit d532d0e0c4
1 changed files with 13 additions and 0 deletions

View File

@ -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'])) {