You are here

public function MenuLinkTreeElementTest::testConstruction in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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 27
Contains \Drupal\Tests\Core\Menu\MenuLinkTreeElementTest.

Class

MenuLinkTreeElementTest
Tests the menu link tree element value object.

Namespace

Drupal\Tests\Core\Menu

Code

public function testConstruction() {
  $link = MenuLinkMock::create(array(
    'id' => 'test',
  ));
  $item = new MenuLinkTreeElement($link, FALSE, 3, FALSE, array());
  $this
    ->assertSame($link, $item->link);
  $this
    ->assertSame(FALSE, $item->hasChildren);
  $this
    ->assertSame(3, $item->depth);
  $this
    ->assertSame(FALSE, $item->inActiveTrail);
  $this
    ->assertSame(array(), $item->subtree);
}