diff --git a/tests/php-unit-tests/unitary-tests/sources/FormSDK/FormFieldTypeEnumerationTest.php b/tests/php-unit-tests/unitary-tests/sources/FormSDK/FormFieldTypeEnumerationTest.php new file mode 100644 index 0000000000..4739d0ef91 --- /dev/null +++ b/tests/php-unit-tests/unitary-tests/sources/FormSDK/FormFieldTypeEnumerationTest.php @@ -0,0 +1,56 @@ +CheckOptions($aFieldOptions); + $this->assertIsArray($aResult); + $this->assertEquals($bExpectedValid, $aResult['valid']); + $this->assertEquals($aExpectedInvalidOptions, $aResult['invalid_options']); + } + + public function CheckOptionsProvider() : array + { + $this->RequireOnceItopFile( 'sources/FormSDK/Field/FormFieldTypeEnumeration.php'); + + return [ + 'SELECT with incompatible option with_minutes' => [ + FormFieldTypeEnumeration::SELECT, + ['label' => 'Fruits', 'with_minutes' => true], + false, + ['with_minutes'] + ], + 'SELECT with GENERIC COMPATIBLE options' => [ + FormFieldTypeEnumeration::SELECT, + ['label' => 'Fruits'], + true, + [] + ], + 'FIELDSET with SPECIFIC COMPATIBLE options' => [ + FormFieldTypeEnumeration::FIELDSET, + ['layout' => []], + true, + [] + ] + ]; + } + + +}