function ModuleLegacyTest::testModuleLoadInstall

Test deprecation of module_load_install() function.

File

core/tests/Drupal/KernelTests/Core/Extension/ModuleLegacyTest.php, line 29

Class

ModuleLegacyTest
Tests deprecations from module.inc file.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testModuleLoadInstall() {
    $this->assertFalse(\Drupal::moduleHandler()->moduleExists('node'), 'The Node module is not installed');
    $this->expectDeprecation('module_load_install() is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Instead, you should use \\Drupal::moduleHandler()->loadInclude($module, \'install\'). Note, the replacement no longer allows including code from uninstalled modules. See https://www.drupal.org/project/drupal/issues/2010380');
    $filename = module_load_install('node');
    $this->assertStringEndsWith("node.install", $filename);
}

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