core/modules/filter/src/Tests/FilterAPITest.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/modules/filter/src/Tests/FilterAPITest.php b/core/modules/filter/src/Tests/FilterAPITest.php index 786bfc0..fc755ec 100644 --- a/core/modules/filter/src/Tests/FilterAPITest.php +++ b/core/modules/filter/src/Tests/FilterAPITest.php @@ -390,21 +390,28 @@ public function assertFilterFormatViolation(ConstraintViolationListInterface $vi /** * Tests that dependency removal works. * - * Uninstalling a module that provides a filter should not remove a filter + * Uninstalling a module that provides a filter should not remove a text * format that uses the filter. */ public function testDependencyRemoval() { $this->installSchema('user', array('users_data')); $filter_format = \Drupal\filter\Entity\FilterFormat::load('filtered_html'); + + // Enable the filter_test_restrict_tags_and_attributes filter. $filter_config = [ 'weight' => 10, 'status' => 1, ]; $filter_format->setFilterConfig('filter_test_restrict_tags_and_attributes', $filter_config)->save(); + + // Verify that a dependency exists on the module that provides the filter. $this->assertEqual(['module' => ['filter_test']], $filter_format->getDependencies()); - \Drupal::moduleHandler()->uninstall(array('filter_test')); + // Uninstall the module. + \Drupal::moduleHandler()->uninstall(array('filter_test')); \Drupal::entityManager()->getStorage('filter_format')->resetCache(); + + // Verify the text format still exists but the dependency and filter is gone. $filter_format = \Drupal\filter\Entity\FilterFormat::load('filtered_html'); $this->assertEqual([], $filter_format->getDependencies()); }