You are here

public function ElementTest::testOrder in Lightning Core 8

Same name and namespace in other branches
  1. 8.5 tests/src/Unit/ElementTest.php \Drupal\Tests\lightning_core\Unit\ElementTest::testOrder()
  2. 8.2 tests/src/Unit/ElementTest.php \Drupal\Tests\lightning_core\Unit\ElementTest::testOrder()
  3. 8.3 tests/src/Unit/ElementTest.php \Drupal\Tests\lightning_core\Unit\ElementTest::testOrder()
  4. 8.4 tests/src/Unit/ElementTest.php \Drupal\Tests\lightning_core\Unit\ElementTest::testOrder()

@covers ::order

File

tests/src/Unit/ElementTest.php, line 41

Class

ElementTest
@coversDefaultClass \Drupal\lightning_core\Element

Namespace

Drupal\Tests\lightning_core\Unit

Code

public function testOrder() {
  $items = [
    'apple' => 1,
    'orange' => 2,
    'banana' => 3,
  ];
  Element::order($items, [
    'banana',
    'apple',
    'orange',
  ]);
  $this
    ->assertSame([
    'banana',
    'apple',
    'orange',
  ], array_keys($items));
}