function FormTest::testElementMappings in Form Builder 7.2
Test whether we have a mapping for every (core) webform component.
File
- modules/
webform/ tests/ FormTest.php, line 445
Class
- FormTest
- Integration test for the webform integration.
Namespace
Drupal\form_builder_webformCode
function testElementMappings() {
$components = webform_webform_component_info();
$element_info = Loader::instance()
->getElementTypeInfo('webform', NULL);
foreach (array_keys($components) as $type) {
$map = _form_builder_webform_property_map($type);
$this
->assertTrue(!empty($map['form_builder_type']), "Unmapped component type '{$type}'.");
$t = $map['form_builder_type'];
$this
->assertTrue(!empty($element_info[$t]), "Component type '{$type}' maps to undefined element_type {$t}");
}
}