You are here

public function DefaultMenuLinkTreeManipulatorsTest::testFlatten in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php \Drupal\Tests\Core\Menu\DefaultMenuLinkTreeManipulatorsTest::testFlatten()

Tests the flatten() tree manipulator.

@covers ::flatten

File

core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php, line 263
Contains \Drupal\Tests\Core\Menu\DefaultMenuLinkTreeManipulatorsTest.

Class

DefaultMenuLinkTreeManipulatorsTest
Tests the default menu link tree manipulators.

Namespace

Drupal\Tests\Core\Menu

Code

public function testFlatten() {
  $this
    ->mockTree();
  $tree = $this->defaultMenuTreeManipulators
    ->flatten($this->originalTree);
  $this
    ->assertEquals(array(
    1,
    2,
    5,
    6,
    8,
    9,
  ), array_keys($this->originalTree));
  $this
    ->assertEquals(array(
    1,
    2,
    5,
    6,
    8,
    9,
    3,
    4,
    7,
  ), array_keys($tree));
}