You are here

protected function InstalledConfigurationTest::cleanupConfigList in Thunder 8.3

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/InstalledConfigurationTest.php \Drupal\Tests\thunder\Functional\InstalledConfigurationTest::cleanupConfigList()
  2. 8.2 tests/src/Functional/InstalledConfigurationTest.php \Drupal\Tests\thunder\Functional\InstalledConfigurationTest::cleanupConfigList()
  3. 8.4 tests/src/Functional/InstalledConfigurationTest.php \Drupal\Tests\thunder\Functional\InstalledConfigurationTest::cleanupConfigList()
  4. 6.2.x tests/src/Functional/InstalledConfigurationTest.php \Drupal\Tests\thunder\Functional\InstalledConfigurationTest::cleanupConfigList()
  5. 6.0.x tests/src/Functional/InstalledConfigurationTest.php \Drupal\Tests\thunder\Functional\InstalledConfigurationTest::cleanupConfigList()
  6. 6.1.x tests/src/Functional/InstalledConfigurationTest.php \Drupal\Tests\thunder\Functional\InstalledConfigurationTest::cleanupConfigList()

Clean up configuration list values.

Parameters

array $list: List of values in configuration object.

array $ignoreValues: Array with list of values that should be ignored.

Return value

array Return cleaned-up list.

1 call to InstalledConfigurationTest::cleanupConfigList()
InstalledConfigurationTest::cleanupConfigurations in tests/src/Functional/InstalledConfigurationTest.php
Return cleaned-up configurations provided as argument.

File

tests/src/Functional/InstalledConfigurationTest.php, line 379

Class

InstalledConfigurationTest
Test for checking of configuration after install of thunder profile.

Namespace

Drupal\Tests\thunder\Functional

Code

protected function cleanupConfigList(array $list, array $ignoreValues) {
  $cleanList = $list;
  if (!empty($cleanList)) {
    foreach ($ignoreValues as $ignoreValue) {
      if (!in_array($ignoreValue, $cleanList)) {
        $cleanList[] = $ignoreValue;
      }
    }
  }
  else {
    $cleanList = $ignoreValues;
  }

  // Sorting is required to get same order for configuration compare.
  sort($cleanList);
  return $cleanList;
}