@@ -386,4 +387,68 @@ public function assertFilterFormatViolation(ConstraintViolationListInterface $vi
}
$this->assertTrue($filter_format_violation_found,format_string('Validation violation for invalid value "%invalid_value" found',array('%invalid_value'=>$invalid_value)));
}
/**
* Tests that filter format dependency removal works.
*
* Ensure that modules providing filter plugins are required when the plugin
* is in use, and that only disabled plugins are removed from format
* configuration entities rather than the configuration entities being
$this->assertTrue($module_data['filter_test']->info['required'],'The filter_test module is required.');
$this->assertEqual($module_data['filter_test']->info['explanation'],String::format('Provides a filter plugin that is in use in the following filter formats: %formats',array('%formats'=>$filter_format->label())));
// Disable the filter_test_restrict_tags_and_attributes filter plugin but
// have custom configuration so that the filter plugin is still configured
// Use the get method to match the assert after the module has been
// uninstalled.
$filters=$filter_format->get('filters');
$this->assertTrue(isset($filters['filter_test_restrict_tags_and_attributes']),'The filter plugin filter_test_restrict_tags_and_attributes is configured by the filtered_html filter format.');
// Use the get method since the FilterFormat::filters() method only returns
// existing plugins.
$filters=$filter_format->get('filters');
$this->assertFalse(isset($filters['filter_test_restrict_tags_and_attributes']),'The filter plugin filter_test_restrict_tags_and_attributes is not configured by the filtered_html filter format.');