function FilterUninstallValidatorTest::testValidateNoPlugins

Same name and namespace in other branches
  1. 11.x core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php \Drupal\Tests\filter\Unit\FilterUninstallValidatorTest::testValidateNoPlugins()
  2. 10 core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php \Drupal\Tests\filter\Unit\FilterUninstallValidatorTest::testValidateNoPlugins()
  3. 9 core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php \Drupal\Tests\filter\Unit\FilterUninstallValidatorTest::testValidateNoPlugins()
  4. 8.9.x core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php \Drupal\Tests\filter\Unit\FilterUninstallValidatorTest::testValidateNoPlugins()

Tests validate no plugins.

File

core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php, line 43

Class

FilterUninstallValidatorTest
Tests Drupal\filter\FilterUninstallValidator.

Namespace

Drupal\Tests\filter\Unit

Code

public function testValidateNoPlugins() : void {
  $this->filterUninstallValidator
    ->expects($this->once())
    ->method('getFilterDefinitionsByProvider')
    ->willReturn([]);
  $this->filterUninstallValidator
    ->expects($this->never())
    ->method('getEnabledFilterFormats');
  $module = $this->randomMachineName();
  $expected = [];
  $reasons = $this->filterUninstallValidator
    ->validate($module);
  $this->assertEquals($expected, $reasons);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.