protected function setUp() { parent::setUp(); $this->links = Navigation::links(array(array('foo', '#'), array('bar', '#'))); }
/** * @dataProvider classes */ public function testStylesAll($class) { $links = Navigation::links(array(array('foo', '#'), array('bar', '#'))); $menu = Navigation::$class($links, true, array('class' => 'bar', 'data-foo' => 'bar')); $match = $this->createNavMatcher($class, 'bar', true); $match['attributes']['data-foo'] = 'bar'; $this->assertHTML($match, $menu); }
public function testActiveTab() { $arr = $this->createLinks(); //Set second tab as active $arr[1][2] = true; $tabs = Tabbable::tabs(Navigation::links($arr)); //Set matcher with $matcher = $this->createMatcher('above', 'tabs', 'Section 2', "Howdy, I'm in Section 2."); $this->assertHTML($matcher, $tabs); }
public function testClosureNotVisibleMenu() { $visible = function ($item) { return $item['label'] === 'bar'; }; $navbar = Navbar::create()->with_menus(Navigation::links(array(array('foo', '#'), array('bar', '#', false, false, null, null, $visible), array('baz', '#', false, false, null, null, $visible)))); $matcher = $this->getBasicMatcher(); $matcher['child']['child']['child'] = array('tag' => 'ul', 'attributes' => array('class' => 'nav'), 'children' => array('count' => 2, 'only' => array('tag' => 'li'))); $this->assertHTML($matcher, $navbar); }