public function DefaultMenuLinkTreeManipulatorsTest::testFlatten in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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\MenuCode
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));
}