You are here

protected function ModuleHandlerTest::assertModuleList in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/service_container/Tests/ModuleHandlerTest.php \Drupal\service_container\Tests\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 lib/Drupal/service_container/Tests/ModuleHandlerTest.php
The basic functionality of retrieving enabled modules.

File

lib/Drupal/service_container/Tests/ModuleHandlerTest.php, line 77
Contains \Drupal\service_container\Tests\ModuleHandlerTest.

Class

ModuleHandlerTest
Tests the module_handler implementation of the service_container.

Namespace

Drupal\service_container\Tests

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());
  $enabled_modules = sort($enabled_modules);
  $this
    ->assertEqual($expected_values, $enabled_modules, format_string('@condition: extension handler returns correct results', array(
    '@condition' => $condition,
  )));
}