You are here

public function FilterUninstallValidatorTest::testValidateNoPlugins in Drupal 8

Same name and namespace in other branches
  1. 9 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()

@covers ::validate

File

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

Class

FilterUninstallValidatorTest
@coversDefaultClass \Drupal\filter\FilterUninstallValidator @group filter

Namespace

Drupal\Tests\filter\Unit

Code

public function testValidateNoPlugins() {
  $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
    ->assertSame($expected, $this
    ->castSafeStrings($reasons));
}