Same filename and directory in other branches
- 8.9.x core/modules/system/tests/src/Kernel/System/InfoAlterTest.php
- 9 core/modules/system/tests/src/Kernel/System/InfoAlterTest.php
Namespace
Drupal\Tests\system\Kernel\System
File
core/modules/system/tests/src/Kernel/System/InfoAlterTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\system\Kernel\System;
use Drupal\KernelTests\KernelTestBase;
class InfoAlterTest extends KernelTestBase {
protected static $modules = [
'system',
];
public function testSystemInfoAlter() {
\Drupal::state()
->set('module_required_test.hook_system_info_alter', TRUE);
$info = \Drupal::service('extension.list.module')
->getList();
$this
->assertFalse(isset($info['node']->info['required']), 'Before the module_required_test is installed the node module is not required.');
\Drupal::service('module_installer')
->install([
'module_required_test',
], FALSE);
$this
->assertTrue(\Drupal::moduleHandler()
->moduleExists('module_required_test'), 'Test required module is enabled.');
$info = \Drupal::service('extension.list.module')
->getList();
$this
->assertTrue($info['node']->info['required'], 'After the module_required_test is installed the node module is required.');
}
}
Classes