function MenuLinkTreeElementTest::testConstruction
Tests construction.
@covers ::__construct
      
    
File
- 
              core/tests/ Drupal/ Tests/ Core/ Menu/ MenuLinkTreeElementTest.php, line 22 
Class
- MenuLinkTreeElementTest
- Tests the menu link tree element value object.
Namespace
Drupal\Tests\Core\MenuCode
public function testConstruction() {
  $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.
