function RequiredModuleUninstallValidatorTest::testValidateNoModule

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php \Drupal\Tests\Core\Extension\RequiredModuleUninstallValidatorTest::testValidateNoModule()
  2. 8.9.x core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php \Drupal\Tests\Core\Extension\RequiredModuleUninstallValidatorTest::testValidateNoModule()
  3. 10 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 35

Class

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

Namespace

Drupal\Tests\Core\Extension

Code

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

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