You are here

public function BetterExposedFiltersHelperUnitTest::testSortNestedOptions in Better Exposed Filters 8.5

Same name and namespace in other branches
  1. 8.4 tests/src/Unit/BetterExposedFiltersHelperUnitTest.php \Drupal\Tests\better_exposed_filters\Unit\BetterExposedFiltersHelperUnitTest::testSortNestedOptions()

Tests options are rewritten correctly.

@dataProvider providerTestSortNestedOptions

@covers ::sortNestedOptions

File

tests/src/Unit/BetterExposedFiltersHelperUnitTest.php, line 287

Class

BetterExposedFiltersHelperUnitTest
Tests the helper functions for better exposed filters.

Namespace

Drupal\Tests\better_exposed_filters\Unit

Code

public function testSortNestedOptions($unsorted, $expected) {
  $sorted = BetterExposedFiltersHelper::sortNestedOptions($unsorted);
  $this
    ->assertArrayEquals(array_values($sorted), array_values($expected));
}