function ModuleRequiredByThemesUninstallValidatorTest::testValidateNoThemeDependency

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php \Drupal\Tests\Core\Extension\ModuleRequiredByThemesUninstallValidatorTest::testValidateNoThemeDependency()
  2. 8.9.x core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php \Drupal\Tests\Core\Extension\ModuleRequiredByThemesUninstallValidatorTest::testValidateNoThemeDependency()
  3. 11.x core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php \Drupal\Tests\Core\Extension\ModuleRequiredByThemesUninstallValidatorTest::testValidateNoThemeDependency()

@covers ::validate

File

core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php, line 52

Class

ModuleRequiredByThemesUninstallValidatorTest
@coversDefaultClass \Drupal\Core\Extension\ModuleRequiredByThemesUninstallValidator @group Extension

Namespace

Drupal\Tests\Core\Extension

Code

public function testValidateNoThemeDependency() : void {
    $this->themeExtensionList
        ->getAllInstalledInfo()
        ->willReturn([
        'stable9' => [
            'name' => 'Stable 9',
            'dependencies' => [],
        ],
        'claro' => [
            'name' => 'Claro',
            'dependencies' => [],
        ],
    ]);
    $module = $this->randomMachineName();
    $expected = [];
    $reasons = $this->moduleRequiredByThemeUninstallValidator
        ->validate($module);
    $this->assertSame($expected, $reasons);
}

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