You are here

protected function WebformSettingsAdminTest::ksort in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/Settings/WebformSettingsAdminTest.php \Drupal\Tests\webform\Functional\Settings\WebformSettingsAdminTest::ksort()

Sort a nested associative array by key.

Parameters

array $array: A nested associative array.

1 call to WebformSettingsAdminTest::ksort()
WebformSettingsAdminTest::testAdminSettings in tests/src/Functional/Settings/WebformSettingsAdminTest.php
Tests webform admin settings.

File

tests/src/Functional/Settings/WebformSettingsAdminTest.php, line 139

Class

WebformSettingsAdminTest
Tests for webform entity.

Namespace

Drupal\Tests\webform\Functional\Settings

Code

protected function ksort(array &$array) {
  ksort($array);
  foreach ($array as &$value) {
    if (is_array($value)) {
      ksort($value);
    }
  }
}