function TopBarItemBaseTest::testTopBarItemBase

@covers ::label @covers ::region

File

core/modules/navigation/tests/src/Unit/TopBarItemBaseTest.php, line 23

Class

TopBarItemBaseTest
@coversDefaultClass \Drupal\navigation\TopBarItemBase

Namespace

Drupal\Tests\navigation\Unit

Code

public function testTopBarItemBase() : void {
    $definition = [
        'label' => new TranslatableMarkup('label'),
        'region' => TopBarRegion::Tools,
    ];
    $top_bar_item_base = new TopBarItemInstantiation([], 'test_top_bar_item_base', $definition);
    $this->assertEquals($definition['label'], $top_bar_item_base->label());
    $this->assertEquals($definition['region'], $top_bar_item_base->region());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.