function TopBarItemBaseTest::testTopBarItemBase
Same name and namespace in other branches
- 11.x core/modules/navigation/tests/src/Unit/TopBarItemBaseTest.php \Drupal\Tests\navigation\Unit\TopBarItemBaseTest::testTopBarItemBase()
Tests top bar item base.
@legacy-covers ::label @legacy-covers ::region @legacy-covers ::weight
File
-
core/
modules/ navigation/ tests/ src/ Unit/ TopBarItemBaseTest.php, line 29
Class
Namespace
Drupal\Tests\navigation\UnitCode
public function testTopBarItemBase() : void {
$definition = [
'label' => new TranslatableMarkup('label'),
'region' => TopBarRegion::Tools,
'weight' => 0,
];
$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());
$this->assertEquals($definition['weight'], $top_bar_item_base->weight());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.