function MenuLinkTreeElementTest::testConstruction
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Menu/MenuLinkTreeElementTest.php \Drupal\Tests\Core\Menu\MenuLinkTreeElementTest::testConstruction()
- 8.9.x core/tests/Drupal/Tests/Core/Menu/MenuLinkTreeElementTest.php \Drupal\Tests\Core\Menu\MenuLinkTreeElementTest::testConstruction()
- 11.x core/tests/Drupal/Tests/Core/Menu/MenuLinkTreeElementTest.php \Drupal\Tests\Core\Menu\MenuLinkTreeElementTest::testConstruction()
Tests construction.
@covers ::__construct
File
-
core/
tests/ Drupal/ Tests/ Core/ Menu/ MenuLinkTreeElementTest.php, line 24
Class
- MenuLinkTreeElementTest
- Tests the menu link tree element value object.
Namespace
Drupal\Tests\Core\MenuCode
public function testConstruction() : void {
$link = MenuLinkMock::create([
'id' => 'test',
]);
$item = new MenuLinkTreeElement($link, FALSE, 3, FALSE, []);
$this->assertSame($link, $item->link);
$this->assertFalse($item->hasChildren);
$this->assertSame(3, $item->depth);
$this->assertFalse($item->inActiveTrail);
$this->assertSame([], $item->subtree);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.