public function ViewsDataTest::testOptionsFieldViewsData in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/options/src/Tests/Views/ViewsDataTest.php \Drupal\options\Tests\Views\ViewsDataTest::testOptionsFieldViewsData()
Tests the option module's implementation of hook_field_views_data().
File
- core/
modules/ options/ src/ Tests/ Views/ ViewsDataTest.php, line 57 - Contains \Drupal\options\Tests\Views\ViewsDataTest.
Class
- ViewsDataTest
- Test to ensure views data is properly created for the Options module.
Namespace
Drupal\options\Tests\ViewsCode
public function testOptionsFieldViewsData() {
$field_data = \Drupal::service('views.views_data')
->get('entity_test__test_options');
// Check that the options module has properly overridden default views data.
$test_options_field = $field_data['test_options_value'];
$this
->assertEqual($test_options_field['argument']['id'], 'string_list_field', 'Argument handler is properly set for fields with allowed value callbacks.');
$this
->assertEqual($test_options_field['filter']['id'], 'list_field', 'Filter handler is properly set for fields with allowed value callbacks.');
}