Commit 19ed41e6 authored by catch's avatar catch

Issue #3093257 by Berdir, alexpott, mikelutz: Install path_alias by default in...

Issue #3093257 by Berdir, alexpott, mikelutz: Install path_alias by default in kernel tests to minimize the impact on contrib tests between alpha and beta

(cherry picked from commit 3d1c53bc)
parent 221bb244
...@@ -24,7 +24,7 @@ class ModuleHandlerTest extends KernelTestBase { ...@@ -24,7 +24,7 @@ class ModuleHandlerTest extends KernelTestBase {
* The basic functionality of retrieving enabled modules. * The basic functionality of retrieving enabled modules.
*/ */
public function testModuleList() { public function testModuleList() {
$module_list = ['system']; $module_list = ['path_alias', 'system'];
$this->assertModuleList($module_list, 'Initial'); $this->assertModuleList($module_list, 'Initial');
......
...@@ -23,7 +23,7 @@ class SystemGetInfoTest extends KernelTestBase { ...@@ -23,7 +23,7 @@ class SystemGetInfoTest extends KernelTestBase {
public function testSystemGetInfo() { public function testSystemGetInfo() {
$system_module_info = system_get_info('module', 'system'); $system_module_info = system_get_info('module', 'system');
$this->assertSame('System', $system_module_info['name']); $this->assertSame('System', $system_module_info['name']);
$this->assertSame(['system' => $system_module_info], system_get_info('module')); $this->assertSame(['path_alias' => system_get_info('module', 'path_alias'), 'system' => $system_module_info], system_get_info('module'));
// The User module is not installed so system_get_info() should return // The User module is not installed so system_get_info() should return
// an empty array. // an empty array.
...@@ -34,7 +34,7 @@ public function testSystemGetInfo() { ...@@ -34,7 +34,7 @@ public function testSystemGetInfo() {
$this->container->get('module_installer')->install(['user']); $this->container->get('module_installer')->install(['user']);
$user_module_info = system_get_info('module', 'user'); $user_module_info = system_get_info('module', 'user');
$this->assertSame('User', $user_module_info['name']); $this->assertSame('User', $user_module_info['name']);
$this->assertSame(['system' => $system_module_info, 'user' => $user_module_info], system_get_info('module')); $this->assertSame(['path_alias' => system_get_info('module', 'path_alias'), 'system' => $system_module_info, 'user' => $user_module_info], system_get_info('module'));
// Test theme info. There are no themes installed yet. // Test theme info. There are no themes installed yet.
$this->assertSame([], system_get_info('theme', 'stable')); $this->assertSame([], system_get_info('theme', 'stable'));
......
...@@ -164,12 +164,17 @@ abstract class KernelTestBase extends TestCase implements ServiceProviderInterfa ...@@ -164,12 +164,17 @@ abstract class KernelTestBase extends TestCase implements ServiceProviderInterfa
* it extends, and so on up the class hierarchy. It is not necessary to * it extends, and so on up the class hierarchy. It is not necessary to
* include modules in your list that a parent class has already declared. * include modules in your list that a parent class has already declared.
* *
* The Path Alias module is always installed because the functionality has
* moved from core to a required module in Drupal 8.8.0. If a kernel test
* requires path alias functionality it is recommended to add the module to
* the test's own $modules property for Drupal 9 compatibility.
*
* @see \Drupal\Tests\KernelTestBase::enableModules() * @see \Drupal\Tests\KernelTestBase::enableModules()
* @see \Drupal\Tests\KernelTestBase::bootKernel() * @see \Drupal\Tests\KernelTestBase::bootKernel()
* *
* @var array * @var array
*/ */
protected static $modules = []; protected static $modules = ['path_alias'];
/** /**
* The virtual filesystem root directory. * The virtual filesystem root directory.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment