InfoAlterTest.php in Zircon Profile 8
File
core/modules/system/src/Tests/System/InfoAlterTest.php
View source
<?php
namespace Drupal\system\Tests\System;
use Drupal\simpletest\KernelTestBase;
class InfoAlterTest extends KernelTestBase {
public static $modules = array(
'system',
);
function testSystemInfoAlter() {
\Drupal::state()
->set('module_required_test.hook_system_info_alter', TRUE);
$info = system_rebuild_module_data();
$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(array(
'module_required_test',
), FALSE);
$this
->assertTrue(\Drupal::moduleHandler()
->moduleExists('module_required_test'), 'Test required module is enabled.');
$info = system_rebuild_module_data();
$this
->assertTrue($info['node']->info['required'], 'After the module_required_test is installed the node module is required.');
}
}