function RequiredModuleUninstallValidatorTest::testValidateNotRequired

Tests validate not required.

@legacy-covers ::validate

File

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

Class

RequiredModuleUninstallValidatorTest
Tests Drupal\Core\Extension\RequiredModuleUninstallValidator.

Namespace

Drupal\Tests\Core\Extension

Code

public function testValidateNotRequired() : void {
  $module = $this->randomMachineName();
  $this->uninstallValidator
    ->expects($this->once())
    ->method('getModuleInfoByModule')
    ->willReturn([
    'required' => FALSE,
    'name' => $module,
  ]);
  $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.