You are here

class ModuleHandlerTest in Zircon Profile 8

Same name in this branch
  1. 8 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest
  2. 8 core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php \Drupal\Tests\system\Kernel\Extension\ModuleHandlerTest
Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php \Drupal\Tests\system\Kernel\Extension\ModuleHandlerTest

Tests ModuleHandler functionality.

@group Extension

Hierarchy

Expanded class hierarchy of ModuleHandlerTest

File

core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php, line 19
Contains \Drupal\system\Tests\Extension\ModuleHandlerTest.

Namespace

Drupal\Tests\system\Kernel\Extension
View source
class ModuleHandlerTest extends KernelTestBase {

  /**
   * {@inheritdoc}
   */
  public static $modules = [
    'system',
  ];

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();

    // @todo ModuleInstaller calls system_rebuild_module_data which is part of
    //   system.module, see https://www.drupal.org/node/2208429.
    include_once $this->root . '/core/modules/system/system.module';

    // Set up the state values so we know where to find the files when running
    // drupal_get_filename().
    // @todo Remove as part of https://www.drupal.org/node/2186491
    system_rebuild_module_data();
  }

  /**
   * {@inheritdoc}
   */
  public function register(ContainerBuilder $container) {
    parent::register($container);

    // Put a fake route bumper on the container to be called during uninstall.
    $container
      ->register('router.dumper', 'Drupal\\Core\\Routing\\NullMatcherDumper');
  }

  /**
   * The basic functionality of retrieving enabled modules.
   */
  function testModuleList() {
    $module_list = [
      'system',
    ];
    $this
      ->assertModuleList($module_list, 'Initial');

    // Try to install a new module.
    $this
      ->moduleInstaller()
      ->install(array(
      'ban',
    ));
    $module_list[] = 'ban';
    sort($module_list);
    $this
      ->assertModuleList($module_list, 'After adding a module');

    // Try to mess with the module weights.
    module_set_weight('ban', 20);

    // Move ban to the end of the array.
    unset($module_list[array_search('ban', $module_list)]);
    $module_list[] = 'ban';
    $this
      ->assertModuleList($module_list, 'After changing weights');

    // Test the fixed list feature.
    $fixed_list = array(
      'system' => 'core/modules/system/system.module',
      'menu' => 'core/modules/menu/menu.module',
    );
    $this
      ->moduleHandler()
      ->setModuleList($fixed_list);
    $new_module_list = array_combine(array_keys($fixed_list), array_keys($fixed_list));
    $this
      ->assertModuleList($new_module_list, t('When using a fixed list'));
  }

  /**
   * Assert that the extension handler returns the expected values.
   *
   * @param array $expected_values
   *   The expected values, sorted by weight and module name.
   * @param $condition
   */
  protected function assertModuleList(array $expected_values, $condition) {
    $expected_values = array_values(array_unique($expected_values));
    $enabled_modules = array_keys($this->container
      ->get('module_handler')
      ->getModuleList());
    $this
      ->assertEqual($expected_values, $enabled_modules, format_string('@condition: extension handler returns correct results', array(
      '@condition' => $condition,
    )));
  }

  /**
   * Tests dependency resolution.
   *
   * Intentionally using fake dependencies added via hook_system_info_alter()
   * for modules that normally do not have any dependencies.
   *
   * To simplify things further, all of the manipulated modules are either
   * purely UI-facing or live at the "bottom" of all dependency chains.
   *
   * @see module_test_system_info_alter()
   * @see https://www.drupal.org/files/issues/dep.gv__0.png
   */
  function testDependencyResolution() {
    $this
      ->enableModules(array(
      'module_test',
    ));
    $this
      ->assertTrue($this
      ->moduleHandler()
      ->moduleExists('module_test'), 'Test module is enabled.');

    // Ensure that modules are not enabled.
    $this
      ->assertFalse($this
      ->moduleHandler()
      ->moduleExists('color'), 'Color module is disabled.');
    $this
      ->assertFalse($this
      ->moduleHandler()
      ->moduleExists('config'), 'Config module is disabled.');
    $this
      ->assertFalse($this
      ->moduleHandler()
      ->moduleExists('help'), 'Help module is disabled.');

    // Create a missing fake dependency.
    // Color will depend on Config, which depends on a non-existing module Foo.
    // Nothing should be installed.
    \Drupal::state()
      ->set('module_test.dependency', 'missing dependency');
    drupal_static_reset('system_rebuild_module_data');
    try {
      $result = $this
        ->moduleInstaller()
        ->install(array(
        'color',
      ));
      $this
        ->fail(t('ModuleInstaller::install() throws an exception if dependencies are missing.'));
    } catch (\Drupal\Core\Extension\MissingDependencyException $e) {
      $this
        ->pass(t('ModuleInstaller::install() throws an exception if dependencies are missing.'));
    }
    $this
      ->assertFalse($this
      ->moduleHandler()
      ->moduleExists('color'), 'ModuleHandler::install() aborts if dependencies are missing.');

    // Fix the missing dependency.
    // Color module depends on Config. Config depends on Help module.
    \Drupal::state()
      ->set('module_test.dependency', 'dependency');
    drupal_static_reset('system_rebuild_module_data');
    $result = $this
      ->moduleInstaller()
      ->install(array(
      'color',
    ));
    $this
      ->assertTrue($result, 'ModuleHandler::install() returns the correct value.');

    // Verify that the fake dependency chain was installed.
    $this
      ->assertTrue($this
      ->moduleHandler()
      ->moduleExists('config') && $this
      ->moduleHandler()
      ->moduleExists('help'), 'Dependency chain was installed.');

    // Verify that the original module was installed.
    $this
      ->assertTrue($this
      ->moduleHandler()
      ->moduleExists('color'), 'Module installation with dependencies succeeded.');

    // Verify that the modules were enabled in the correct order.
    $module_order = \Drupal::state()
      ->get('module_test.install_order') ?: array();
    $this
      ->assertEqual($module_order, array(
      'help',
      'config',
      'color',
    ));

    // Uninstall all three modules explicitly, but in the incorrect order,
    // and make sure that ModuleHandler::uninstall() uninstalled them in the
    // correct sequence.
    $result = $this
      ->moduleInstaller()
      ->uninstall(array(
      'config',
      'help',
      'color',
    ));
    $this
      ->assertTrue($result, 'ModuleHandler::uninstall() returned TRUE.');
    foreach (array(
      'color',
      'config',
      'help',
    ) as $module) {
      $this
        ->assertEqual(drupal_get_installed_schema_version($module), SCHEMA_UNINSTALLED, "{$module} module was uninstalled.");
    }
    $uninstalled_modules = \Drupal::state()
      ->get('module_test.uninstall_order') ?: array();
    $this
      ->assertEqual($uninstalled_modules, array(
      'color',
      'config',
      'help',
    ), 'Modules were uninstalled in the correct order.');

    // Enable Color module again, which should enable both the Config module and
    // Help module. But, this time do it with Config module declaring a
    // dependency on a specific version of Help module in its info file. Make
    // sure that Drupal\Core\Extension\ModuleHandler::install() still works.
    \Drupal::state()
      ->set('module_test.dependency', 'version dependency');
    drupal_static_reset('system_rebuild_module_data');
    $result = $this
      ->moduleInstaller()
      ->install(array(
      'color',
    ));
    $this
      ->assertTrue($result, 'ModuleHandler::install() returns the correct value.');

    // Verify that the fake dependency chain was installed.
    $this
      ->assertTrue($this
      ->moduleHandler()
      ->moduleExists('config') && $this
      ->moduleHandler()
      ->moduleExists('help'), 'Dependency chain was installed.');

    // Verify that the original module was installed.
    $this
      ->assertTrue($this
      ->moduleHandler()
      ->moduleExists('color'), 'Module installation with version dependencies succeeded.');

    // Finally, verify that the modules were enabled in the correct order.
    $enable_order = \Drupal::state()
      ->get('module_test.install_order') ?: array();
    $this
      ->assertIdentical($enable_order, array(
      'help',
      'config',
      'color',
    ));
  }

  /**
   * Tests uninstalling a module that is a "dependency" of a profile.
   */
  function testUninstallProfileDependency() {
    $profile = 'minimal';
    $dependency = 'dblog';
    $this
      ->setSetting('install_profile', $profile);

    // Prime the drupal_get_filename() static cache with the location of the
    // minimal profile as it is not the currently active profile and we don't
    // yet have any cached way to retrieve its location.
    // @todo Remove as part of https://www.drupal.org/node/2186491
    drupal_get_filename('profile', $profile, 'core/profiles/' . $profile . '/' . $profile . '.info.yml');
    $this
      ->enableModules(array(
      'module_test',
      $profile,
    ));
    drupal_static_reset('system_rebuild_module_data');
    $data = system_rebuild_module_data();
    $this
      ->assertTrue(isset($data[$profile]->requires[$dependency]));
    $this
      ->moduleInstaller()
      ->install(array(
      $dependency,
    ));
    $this
      ->assertTrue($this
      ->moduleHandler()
      ->moduleExists($dependency));

    // Uninstall the profile module "dependency".
    $result = $this
      ->moduleInstaller()
      ->uninstall(array(
      $dependency,
    ));
    $this
      ->assertTrue($result, 'ModuleHandler::uninstall() returns TRUE.');
    $this
      ->assertFalse($this
      ->moduleHandler()
      ->moduleExists($dependency));
    $this
      ->assertEqual(drupal_get_installed_schema_version($dependency), SCHEMA_UNINSTALLED, "{$dependency} module was uninstalled.");

    // Verify that the installation profile itself was not uninstalled.
    $uninstalled_modules = \Drupal::state()
      ->get('module_test.uninstall_order') ?: array();
    $this
      ->assertTrue(in_array($dependency, $uninstalled_modules), "{$dependency} module is in the list of uninstalled modules.");
    $this
      ->assertFalse(in_array($profile, $uninstalled_modules), 'The installation profile is not in the list of uninstalled modules.');
  }

  /**
   * Tests uninstalling a module that has content.
   */
  function testUninstallContentDependency() {
    $this
      ->enableModules(array(
      'module_test',
      'entity_test',
      'text',
      'user',
      'help',
    ));
    $this
      ->assertTrue($this
      ->moduleHandler()
      ->moduleExists('entity_test'), 'Test module is enabled.');
    $this
      ->assertTrue($this
      ->moduleHandler()
      ->moduleExists('module_test'), 'Test module is enabled.');
    $this
      ->installSchema('user', 'users_data');
    $entity_types = \Drupal::entityManager()
      ->getDefinitions();
    foreach ($entity_types as $entity_type) {
      if ('entity_test' == $entity_type
        ->getProvider()) {
        $this
          ->installEntitySchema($entity_type
          ->id());
      }
    }

    // Create a fake dependency.
    // entity_test will depend on help. This way help can not be uninstalled
    // when there is test content preventing entity_test from being uninstalled.
    \Drupal::state()
      ->set('module_test.dependency', 'dependency');
    drupal_static_reset('system_rebuild_module_data');

    // Create an entity so that the modules can not be disabled.
    $entity = entity_create('entity_test', array(
      'name' => $this
        ->randomString(),
    ));
    $entity
      ->save();

    // Uninstalling entity_test is not possible when there is content.
    try {
      $message = 'ModuleHandler::uninstall() throws ModuleUninstallValidatorException upon uninstalling a module which does not pass validation.';
      $this
        ->moduleInstaller()
        ->uninstall(array(
        'entity_test',
      ));
      $this
        ->fail($message);
    } catch (ModuleUninstallValidatorException $e) {
      $this
        ->pass(get_class($e) . ': ' . $e
        ->getMessage());
    }

    // Uninstalling help needs entity_test to be un-installable.
    try {
      $message = 'ModuleHandler::uninstall() throws ModuleUninstallValidatorException upon uninstalling a module which does not pass validation.';
      $this
        ->moduleInstaller()
        ->uninstall(array(
        'help',
      ));
      $this
        ->fail($message);
    } catch (ModuleUninstallValidatorException $e) {
      $this
        ->pass(get_class($e) . ': ' . $e
        ->getMessage());
    }

    // Deleting the entity.
    $entity
      ->delete();
    $result = $this
      ->moduleInstaller()
      ->uninstall(array(
      'help',
    ));
    $this
      ->assertTrue($result, 'ModuleHandler::uninstall() returns TRUE.');
    $this
      ->assertEqual(drupal_get_installed_schema_version('entity_test'), SCHEMA_UNINSTALLED, "entity_test module was uninstalled.");
  }

  /**
   * Tests whether the correct module metadata is returned.
   */
  function testModuleMetaData() {

    // Generate the list of available modules.
    $modules = system_rebuild_module_data();

    // Check that the mtime field exists for the system module.
    $this
      ->assertTrue(!empty($modules['system']->info['mtime']), 'The system.info.yml file modification time field is present.');

    // Use 0 if mtime isn't present, to avoid an array index notice.
    $test_mtime = !empty($modules['system']->info['mtime']) ? $modules['system']->info['mtime'] : 0;

    // Ensure the mtime field contains a number that is greater than zero.
    $this
      ->assertTrue(is_numeric($test_mtime) && $test_mtime > 0, 'The system.info.yml file modification time field contains a timestamp.');
  }

  /**
   * Tests whether module-provided stream wrappers are registered properly.
   */
  public function testModuleStreamWrappers() {

    // file_test.module provides (among others) a 'dummy' stream wrapper.
    // Verify that it is not registered yet to prevent false positives.
    $stream_wrappers = \Drupal::service('stream_wrapper_manager')
      ->getWrappers();
    $this
      ->assertFalse(isset($stream_wrappers['dummy']));
    $this
      ->moduleInstaller()
      ->install([
      'file_test',
    ]);

    // Verify that the stream wrapper is available even without calling
    // \Drupal::service('stream_wrapper_manager')->getWrappers() again.
    // If the stream wrapper is not available file_exists() will raise a notice.
    file_exists('dummy://');
    $stream_wrappers = \Drupal::service('stream_wrapper_manager')
      ->getWrappers();
    $this
      ->assertTrue(isset($stream_wrappers['dummy']));
  }

  /**
   * Tests whether the correct theme metadata is returned.
   */
  function testThemeMetaData() {

    // Generate the list of available themes.
    $themes = \Drupal::service('theme_handler')
      ->rebuildThemeData();

    // Check that the mtime field exists for the bartik theme.
    $this
      ->assertTrue(!empty($themes['bartik']->info['mtime']), 'The bartik.info.yml file modification time field is present.');

    // Use 0 if mtime isn't present, to avoid an array index notice.
    $test_mtime = !empty($themes['bartik']->info['mtime']) ? $themes['bartik']->info['mtime'] : 0;

    // Ensure the mtime field contains a number that is greater than zero.
    $this
      ->assertTrue(is_numeric($test_mtime) && $test_mtime > 0, 'The bartik.info.yml file modification time field contains a timestamp.');
  }

  /**
   * Returns the ModuleHandler.
   *
   * @return \Drupal\Core\Extension\ModuleHandlerInterface
   */
  protected function moduleHandler() {
    return $this->container
      ->get('module_handler');
  }

  /**
   * Returns the ModuleInstaller.
   *
   * @return \Drupal\Core\Extension\ModuleInstallerInterface
   */
  protected function moduleInstaller() {
    return $this->container
      ->get('module_installer');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AssertContentTrait::$content protected property The current raw content.
AssertContentTrait::$drupalSettings protected property The drupalSettings value from the current raw $content.
AssertContentTrait::$elements protected property The XML structure parsed from the current raw $content. 2
AssertContentTrait::$plainTextContent protected property The plain-text content of raw $content (text nodes).
AssertContentTrait::assertEscaped protected function Passes if the raw text IS found escaped on the loaded page, fail otherwise.
AssertContentTrait::assertField protected function Asserts that a field exists with the given name or ID.
AssertContentTrait::assertFieldById protected function Asserts that a field exists with the given ID and value.
AssertContentTrait::assertFieldByName protected function Asserts that a field exists with the given name and value.
AssertContentTrait::assertFieldByXPath protected function Asserts that a field exists in the current page by the given XPath.
AssertContentTrait::assertFieldChecked protected function Asserts that a checkbox field in the current page is checked.
AssertContentTrait::assertFieldsByValue protected function Asserts that a field exists in the current page with a given Xpath result.
AssertContentTrait::assertLink protected function Passes if a link with the specified label is found.
AssertContentTrait::assertLinkByHref protected function Passes if a link containing a given href (part) is found.
AssertContentTrait::assertNoDuplicateIds protected function Asserts that each HTML ID is used for just a single element.
AssertContentTrait::assertNoEscaped protected function Passes if the raw text IS NOT found escaped on the loaded page, fail otherwise.
AssertContentTrait::assertNoField protected function Asserts that a field does not exist with the given name or ID.
AssertContentTrait::assertNoFieldById protected function Asserts that a field does not exist with the given ID and value.
AssertContentTrait::assertNoFieldByName protected function Asserts that a field does not exist with the given name and value.
AssertContentTrait::assertNoFieldByXPath protected function Asserts that a field does not exist or its value does not match, by XPath.
AssertContentTrait::assertNoFieldChecked protected function Asserts that a checkbox field in the current page is not checked.
AssertContentTrait::assertNoLink protected function Passes if a link with the specified label is not found.
AssertContentTrait::assertNoLinkByHref protected function Passes if a link containing a given href (part) is not found.
AssertContentTrait::assertNoLinkByHrefInMainRegion protected function Passes if a link containing a given href is not found in the main region.
AssertContentTrait::assertNoOption protected function Asserts that a select option in the current page does not exist.
AssertContentTrait::assertNoOptionSelected protected function Asserts that a select option in the current page is not checked.
AssertContentTrait::assertNoPattern protected function Triggers a pass if the perl regex pattern is not found in raw content.
AssertContentTrait::assertNoRaw protected function Passes if the raw text is NOT found on the loaded page, fail otherwise.
AssertContentTrait::assertNoText protected function Passes if the page (with HTML stripped) does not contains the text.
AssertContentTrait::assertNoTitle protected function Pass if the page title is not the given string.
AssertContentTrait::assertNoUniqueText protected function Passes if the text is found MORE THAN ONCE on the text version of the page.
AssertContentTrait::assertOption protected function Asserts that a select option in the current page exists.
AssertContentTrait::assertOptionSelected protected function Asserts that a select option in the current page is checked.
AssertContentTrait::assertOptionSelectedWithDrupalSelector protected function Asserts that a select option in the current page is checked.
AssertContentTrait::assertOptionWithDrupalSelector protected function Asserts that a select option in the current page exists.
AssertContentTrait::assertPattern protected function Triggers a pass if the Perl regex pattern is found in the raw content.
AssertContentTrait::assertRaw protected function Passes if the raw text IS found on the loaded page, fail otherwise.
AssertContentTrait::assertText protected function Passes if the page (with HTML stripped) contains the text.
AssertContentTrait::assertTextHelper protected function Helper for assertText and assertNoText.
AssertContentTrait::assertTextPattern protected function Asserts that a Perl regex pattern is found in the plain-text content.
AssertContentTrait::assertThemeOutput protected function Asserts themed output.
AssertContentTrait::assertTitle protected function Pass if the page title is the given string.
AssertContentTrait::assertUniqueText protected function Passes if the text is found ONLY ONCE on the text version of the page.
AssertContentTrait::assertUniqueTextHelper protected function Helper for assertUniqueText and assertNoUniqueText.
AssertContentTrait::buildXPathQuery protected function Builds an XPath query.
AssertContentTrait::constructFieldXpath protected function Helper: Constructs an XPath for the given set of attributes and value.
AssertContentTrait::cssSelect protected function Searches elements using a CSS selector in the raw content.
AssertContentTrait::getAllOptions protected function Get all option elements, including nested options, in a select.
AssertContentTrait::getDrupalSettings protected function Gets the value of drupalSettings for the currently-loaded page.
AssertContentTrait::getRawContent protected function Gets the current raw content.
AssertContentTrait::getSelectedItem protected function Get the selected value from a select field.
AssertContentTrait::getTextContent protected function Retrieves the plain-text content from the current raw content.
AssertContentTrait::getUrl protected function Get the current URL from the cURL handler. 1
AssertContentTrait::parse protected function Parse content returned from curlExec using DOM and SimpleXML.
AssertContentTrait::removeWhiteSpace protected function Removes all white-space between HTML tags from the raw content.
AssertContentTrait::setDrupalSettings protected function Sets the value of drupalSettings for the currently-loaded page.
AssertContentTrait::setRawContent protected function Sets the raw content (e.g. HTML).
AssertContentTrait::xpath protected function Performs an xpath search on the contents of the internal browser.
AssertHelperTrait::castSafeStrings protected function Casts MarkupInterface objects into strings.
AssertLegacyTrait::assert Deprecated protected function
AssertLegacyTrait::assertEqual Deprecated protected function
AssertLegacyTrait::assertFalse public static function
AssertLegacyTrait::assertIdentical Deprecated protected function
AssertLegacyTrait::assertIdenticalObject Deprecated protected function
AssertLegacyTrait::assertNotEqual Deprecated protected function
AssertLegacyTrait::assertNotIdentical Deprecated protected function
AssertLegacyTrait::assertTrue public static function
AssertLegacyTrait::pass Deprecated protected function
AssertLegacyTrait::verbose protected function
KernelTestBase::$backupGlobals protected property Back up and restore any global variables that may be changed by tests.
KernelTestBase::$backupStaticAttributes protected property Back up and restore static class properties that may be changed by tests.
KernelTestBase::$backupStaticAttributesBlacklist protected property Contains a few static class properties for performance.
KernelTestBase::$classLoader protected property
KernelTestBase::$configImporter protected property @todo Move into Config test base class.
KernelTestBase::$container protected property
KernelTestBase::$databasePrefix protected property
KernelTestBase::$expectedLogMessage protected property
KernelTestBase::$expectedLogSeverity protected property
KernelTestBase::$initialContainerBuilder private static property
KernelTestBase::$preserveGlobalState protected property Do not forward any global state from the parent process to the processes that run the actual tests.
KernelTestBase::$root protected property The app root.
KernelTestBase::$runTestInSeparateProcess protected property Kernel tests are run in separate processes to prevent collisions between code that may be loaded by tests.
KernelTestBase::$siteDirectory protected property
KernelTestBase::$strictConfigSchema protected property Set to TRUE to strict check all configuration saved.
KernelTestBase::$vfsRoot protected property The virtual filesystem root directory.
KernelTestBase::assertPostConditions protected function
KernelTestBase::bootEnvironment protected function Bootstraps a basic test environment.
KernelTestBase::bootKernel private function Bootstraps a kernel for a test.
KernelTestBase::config protected function Configuration accessor for tests. Returns non-overridden configuration.
KernelTestBase::configImporter protected function Returns a ConfigImporter object to import test configuration.
KernelTestBase::copyConfig protected function Copies configuration objects from a source storage to a target storage.
KernelTestBase::disableModules protected function Disables modules for this test.
KernelTestBase::enableModules protected function Enables modules for this test.
KernelTestBase::getCompiledContainerBuilder private function Prepares a precompiled ContainerBuilder for all tests of this class.
KernelTestBase::getDatabaseConnectionInfo protected function Returns the Database connection info to be used for this test.
KernelTestBase::getDrupalRoot protected static function Returns the drupal root directory.
KernelTestBase::getExtensionsForModules private function Returns Extension objects for $modules to enable.
KernelTestBase::getModulesToEnable private static function Returns the modules to enable for this test.
KernelTestBase::initFileCache protected function Initializes the FileCache component.
KernelTestBase::installConfig protected function Installs default configuration for a given list of modules.
KernelTestBase::installEntitySchema protected function Installs the storage schema for a specific entity type.
KernelTestBase::installSchema protected function Installs database tables from a module schema definition.
KernelTestBase::isTestInIsolation protected function Returns whether the current test runs in isolation.
KernelTestBase::prepareTemplate protected function
KernelTestBase::render protected function Renders a render array.
KernelTestBase::setSetting protected function Sets an in-memory Settings variable.
KernelTestBase::setUpBeforeClass public static function
KernelTestBase::stop protected function Stops test execution.
KernelTestBase::tearDown protected function 6
KernelTestBase::tearDownAfterClass public static function
KernelTestBase::tearDownCloseDatabaseConnection public function @after
KernelTestBase::vfsDump protected function Dumps the current state of the virtual filesystem to STDOUT.
KernelTestBase::__get Deprecated public function BC: Automatically resolve former KernelTestBase class properties.
ModuleHandlerTest::$modules public static property Modules to enable. Overrides KernelTestBase::$modules
ModuleHandlerTest::assertModuleList protected function Assert that the extension handler returns the expected values.
ModuleHandlerTest::moduleHandler protected function Returns the ModuleHandler.
ModuleHandlerTest::moduleInstaller protected function Returns the ModuleInstaller.
ModuleHandlerTest::register public function Registers test-specific services. Overrides KernelTestBase::register
ModuleHandlerTest::setUp protected function Overrides KernelTestBase::setUp
ModuleHandlerTest::testDependencyResolution function Tests dependency resolution.
ModuleHandlerTest::testModuleList function The basic functionality of retrieving enabled modules.
ModuleHandlerTest::testModuleMetaData function Tests whether the correct module metadata is returned.
ModuleHandlerTest::testModuleStreamWrappers public function Tests whether module-provided stream wrappers are registered properly.
ModuleHandlerTest::testThemeMetaData function Tests whether the correct theme metadata is returned.
ModuleHandlerTest::testUninstallContentDependency function Tests uninstalling a module that has content.
ModuleHandlerTest::testUninstallProfileDependency function Tests uninstalling a module that is a "dependency" of a profile.
RandomGeneratorTrait::$randomGenerator protected property The random generator.
RandomGeneratorTrait::getRandomGenerator protected function Gets the random generator for the utility methods.
RandomGeneratorTrait::randomMachineName protected function Generates a unique random string containing letters and numbers.
RandomGeneratorTrait::randomObject public function Generates a random PHP object.
RandomGeneratorTrait::randomString public function Generates a pseudo-random string of ASCII characters of codes 32 to 126.
RandomGeneratorTrait::randomStringValidate public function Callback for random string validation.