function FieldInfoTest::testWidgetDefinition

Test that the widget definition functions work.

File

drupal/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php, line 335
Definition of Drupal\field\Tests\FieldInfoTest.

Class

FieldInfoTest

Namespace

Drupal\field\Tests

Code

function testWidgetDefinition() {
  $widget_definition = field_info_widget_types('test_field_widget_multiple');

  // Test if hook_field_widget_info_alter is beïng called.
  $this
    ->assertTrue(in_array('test_field', $widget_definition['field_types']), "The 'test_field_widget_multiple' widget is enabled for the 'test_field' field type in field_test_field_widget_info_alter().");
}