mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-29 21:00:14 +02:00
[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:
@@ -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'])) {
|
||||
|
Reference in New Issue
Block a user