public function appendLink($label, array $linkAttributes = array(), array $attributes = array()) { $item = new MenuItem($label, $attributes); $item->setLinkAttributes($linkAttributes); $this->addMenuItem($item); return $item; }
public function testMenuItem() { $item = new MenuItem('Product Collection'); $item->setTitle('Product Collection'); $item->setLink('Product Collection', ['href' => '/products', 'data-target' => '#productContainer', 'dataContainer' => 'body']); ok('<li role="menuitem" itemprop="itemListElement"><a href="/products" data-target="#productContainer" data-container="body">Product Collection</a></li>', $item->render()); }