You are here

public function RequiredModuleUninstallValidatorTest::testValidateNoModule in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php \Drupal\Tests\Core\Extension\RequiredModuleUninstallValidatorTest::testValidateNoModule()
  2. 9 core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php \Drupal\Tests\Core\Extension\RequiredModuleUninstallValidatorTest::testValidateNoModule()

@covers ::validate

File

core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php, line 33

Class

RequiredModuleUninstallValidatorTest
@coversDefaultClass \Drupal\Core\Extension\RequiredModuleUninstallValidator @group Extension

Namespace

Drupal\Tests\Core\Extension

Code

public function testValidateNoModule() {
  $this->uninstallValidator
    ->expects($this
    ->once())
    ->method('getModuleInfoByModule')
    ->willReturn([]);
  $module = $this
    ->randomMachineName();
  $expected = [];
  $reasons = $this->uninstallValidator
    ->validate($module);
  $this
    ->assertSame($expected, $reasons);
}