You are here

protected function ModuleHandlerTest::assertModuleList in Zircon Profile 8

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::assertModuleList()

Assert that the extension handler returns the expected values.

Parameters

array $expected_values: The expected values, sorted by weight and module name.

$condition:

1 call to ModuleHandlerTest::assertModuleList()
ModuleHandlerTest::testModuleList in core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
The basic functionality of retrieving enabled modules.

File

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

Class

ModuleHandlerTest
Tests ModuleHandler functionality.

Namespace

Drupal\Tests\system\Kernel\Extension

Code

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,
  )));
}