You are here

public function ModulesWeightTest::providerGetModulesList in Modules weight 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/ModulesWeightTest.php \Drupal\Tests\modules_weight\Unit\ModulesWeightTest::providerGetModulesList()

Data provider for testGetModulesList().

Return value

array An array of arrays, each containing:

  • 'expected' - Expected return from getModulesList().
  • 'show_core_modules' - Force to show the core modules.

See also

testGetModulesList()

File

tests/src/Unit/ModulesWeightTest.php, line 110

Class

ModulesWeightTest
Tests the ModulesWeight class methods.

Namespace

Drupal\Tests\modules_weight\Unit

Code

public function providerGetModulesList() {

  // Show core modules.
  $show_core_modules['modules_weight'] = [
    'name' => 'Modules Weight',
    'description' => 'Allows to change the modules execution order.',
    'weight' => -5,
    'package' => 'Development',
  ];
  $show_core_modules['views'] = [
    'name' => 'Views',
    'description' => 'Create customized lists and queries from your database.',
    'weight' => 0,
    'package' => 'Core',
  ];
  $show_core_modules['admin_toolbar'] = [
    'name' => 'Admin Toolbar',
    'description' => 'Provides a drop-down menu interface to the core Drupal Toolbar.',
    'weight' => 3,
    'package' => 'Administration',
  ];

  // Not show core modules.
  $not_show_core_modules['modules_weight'] = [
    'name' => 'Modules Weight',
    'description' => 'Allows to change the modules execution order.',
    'weight' => -5,
    'package' => 'Development',
  ];
  $not_show_core_modules['admin_toolbar'] = [
    'name' => 'Admin Toolbar',
    'description' => 'Provides a drop-down menu interface to the core Drupal Toolbar.',
    'weight' => 3,
    'package' => 'Administration',
  ];
  $tests['show core modules'] = [
    $show_core_modules,
    TRUE,
  ];
  $tests['not show core modules'] = [
    $not_show_core_modules,
    FALSE,
  ];
  return $tests;
}