You are here

public function ConfigListerTest::testListProviders in Configuration Update Manager 8

@covers \Drupal\config_update\ConfigListerWithProviders::listProviders

File

tests/src/Unit/ConfigListerTest.php, line 237

Class

ConfigListerTest
Tests the \Drupal\config_update\ConfigListerWithProviders class.

Namespace

Drupal\Tests\config_update\Unit

Code

public function testListProviders() {

  // This method's return value is not sorted in any particular way.
  $return = $this->configLister
    ->listProviders();
  $expected = [];
  foreach ($this->configProviderList as $provider => $info) {

    // Info has: [type, install storage items, optional storage items], with
    // only the first item in each list that should be present in
    // listProviders().
    // Expected needs: key is item name, value is [type, provider name].
    $expected[$info[1][0]] = [
      $info[0],
      $provider,
    ];
    $expected[$info[2][0]] = [
      $info[0],
      $provider,
    ];
  }
  ksort($return);
  ksort($expected);
  $this
    ->assertEquals($return, $expected);
}