Drupal 8  8.0.2
ModuleHandlerTest Class Reference
Inheritance diagram for ModuleHandlerTest:

Public Member Functions

 register (ContainerBuilder $container)
 
 testModuleList ()
 
 testDependencyResolution ()
 
 testUninstallProfileDependency ()
 
 testUninstallContentDependency ()
 
 testModuleMetaData ()
 
 testModuleStreamWrappers ()
 
 testThemeMetaData ()
 

Static Public Attributes

static $modules = ['system']
 

Protected Member Functions

 setUp ()
 
 assertModuleList (Array $expected_values, $condition)
 
 moduleHandler ()
 
 moduleInstaller ()
 

Detailed Description

Tests ModuleHandler functionality.

Extension

Member Function Documentation

assertModuleList ( Array  $expected_values,
  $condition 
)
protected

Assert that the extension handler returns the expected values.

Parameters
array$expected_valuesThe expected values, sorted by weight and module name.
$condition

References format_string().

Referenced by ModuleHandlerTest\testModuleList().

Here is the call graph for this function:

Here is the caller graph for this function:

moduleHandler ( )
protected

Returns the ModuleHandler.

Returns

Referenced by ModuleHandlerTest\testDependencyResolution(), ModuleHandlerTest\testModuleList(), ModuleHandlerTest\testUninstallContentDependency(), and ModuleHandlerTest\testUninstallProfileDependency().

Here is the caller graph for this function:

moduleInstaller ( )
protected

Returns the ModuleInstaller.

Returns

Referenced by ModuleHandlerTest\testDependencyResolution(), ModuleHandlerTest\testModuleList(), ModuleHandlerTest\testModuleStreamWrappers(), ModuleHandlerTest\testUninstallContentDependency(), and ModuleHandlerTest\testUninstallProfileDependency().

Here is the caller graph for this function:

register ( ContainerBuilder  $container)

{}

setUp ( )
protected

{}

References Drupal\root().

Here is the call graph for this function:

testDependencyResolution ( )

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 Also
module_test_system_info_alter()
https://www.drupal.org/files/issues/dep.gv__0.png

References drupal_get_installed_schema_version(), ModuleHandlerTest\moduleHandler(), ModuleHandlerTest\moduleInstaller(), SCHEMA_UNINSTALLED, Drupal\state(), and t().

Here is the call graph for this function:

testModuleList ( )

The basic functionality of retrieving enabled modules.

References ModuleHandlerTest\assertModuleList(), ModuleHandlerTest\moduleHandler(), ModuleHandlerTest\moduleInstaller(), and t().

Here is the call graph for this function:

testModuleMetaData ( )

Tests whether the correct module metadata is returned.

References ModuleHandlerTest\$modules.

testModuleStreamWrappers ( )

Tests whether module-provided stream wrappers are registered properly.

References ModuleHandlerTest\moduleInstaller(), and Drupal\service().

Here is the call graph for this function:

testThemeMetaData ( )

Tests whether the correct theme metadata is returned.

References Drupal\service().

Here is the call graph for this function:

testUninstallContentDependency ( )

Tests uninstalling a module that has content.

References drupal_get_installed_schema_version(), Drupal\entityManager(), ModuleHandlerTest\moduleHandler(), ModuleHandlerTest\moduleInstaller(), SCHEMA_UNINSTALLED, and Drupal\state().

Here is the call graph for this function:

testUninstallProfileDependency ( )

Tests uninstalling a module that is a "dependency" of a profile.

References drupal_get_installed_schema_version(), ModuleHandlerTest\moduleHandler(), ModuleHandlerTest\moduleInstaller(), SCHEMA_UNINSTALLED, and Drupal\state().

Here is the call graph for this function:

Field Documentation

$modules = ['system']
static

The documentation for this class was generated from the following file: