/**
  * @dataProvider menuStructureProvider
  * @param array $options
  */
 public function testBuild($options)
 {
     $this->configurationBuilder->setConfiguration($options);
     $menu = new MenuItem('navbar', $this->factory);
     $this->configurationBuilder->build($menu, array(), 'navbar');
     $this->assertCount(2, $menu->getChildren());
     $this->assertEquals($options['tree']['navbar']['type'], $menu->getExtra('type'));
     $this->assertCount(count($options['tree']['navbar']['children']['user_user_show']['children']), $menu->getChild('user_user_show'));
     $this->assertEquals('user_user_show', $menu->getChild('user_user_show')->getName());
 }
 protected function setUp()
 {
     $this->container = new Container();
     $this->breadcrumbManager = $this->getMockBuilder('Oro\\Bundle\\NavigationBundle\\Menu\\BreadcrumbManager')->disableOriginalConstructor()->getMock();
     $this->helper = $this->getMockBuilder('Knp\\Menu\\Twig\\Helper')->disableOriginalConstructor()->setMethods(['render'])->getMock();
     $this->factory = $this->getMockBuilder('Knp\\Menu\\MenuFactory')->setMethods(['getRouteInfo', 'processRoute'])->getMock();
     $this->factory->expects($this->any())->method('getRouteInfo')->will($this->returnValue(false));
     $this->factory->expects($this->any())->method('processRoute')->will($this->returnSelf());
     /** @var $eventDispatcher EventDispatcherInterface */
     $eventDispatcher = $this->getMockBuilder('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface')->getMock();
     $provider = new BuilderChainProvider($this->factory, $eventDispatcher);
     $this->builder = new ConfigurationBuilder();
     $this->builder->setContainer($this->container);
     $provider->addBuilder($this->builder);
     $this->menuExtension = new MenuExtension($this->helper, $provider, $this->breadcrumbManager, $this->container);
 }