diff --git a/core/modules/system/tests/src/Kernel/System/SystemGetInfoTest.php b/core/modules/system/tests/src/Kernel/System/SystemGetInfoTest.php index f0bb9e74c0..cd42fa4870 100644 --- a/core/modules/system/tests/src/Kernel/System/SystemGetInfoTest.php +++ b/core/modules/system/tests/src/Kernel/System/SystemGetInfoTest.php @@ -17,15 +17,28 @@ class SystemGetInfoTest extends KernelTestBase { * Tests system_get_info(). */ public function testSystemGetInfo() { - $this->assertEquals('System', system_get_info('module', 'system')['name']); + $system_module_info = system_get_info('module', 'system'); + $this->assertSame('System', $system_module_info['name']); + $this->assertSame(['system' => $system_module_info], system_get_info('module')); + // The User module is not installed so system_get_info() should return // an empty array. - $this->assertEquals([], system_get_info('module', 'user')); + $this->assertSame([], system_get_info('module', 'user')); // Install the User module and check system_get_info() returns the correct // information. $this->container->get('module_installer')->install(['user']); - $this->assertEquals('User', system_get_info('module', 'user')['name']); + $user_module_info = system_get_info('module', 'user'); + $this->assertSame('User', $user_module_info['name']); + $this->assertSame(['system' => $system_module_info, 'user' => $user_module_info], system_get_info('module')); + + // Test theme info. There are no themes installed yet. + $this->assertSame([], system_get_info('theme', 'stable')); + $this->assertSame([], system_get_info('theme')); + $this->container->get('theme_installer')->install(['stable']); + $stable_theme_info = system_get_info('theme', 'stable'); + $this->assertSame('Stable', $stable_theme_info['name']); + $this->assertSame(['stable' => $stable_theme_info], system_get_info('theme')); } }