Author: XE Developers (developers@xpressengine.com)
Inheritance: implements Illuminate\Routing\Matching\ValidatorInterface
 /**
  * testBoardMatchUri
  *
  * @return void
  */
 public function testBoardMatchUri()
 {
     list($routeRepo, $menuHandler, $themeHandler, $siteHandler, $route, $request) = $this->getMocks();
     $moduleValidator = new ModuleValidator();
     $moduleValidator->boot($routeRepo, $menuHandler, $themeHandler, $siteHandler);
     $request->shouldReceive('segment')->with(1)->andReturn('board');
     $route->shouldReceive('getAction')->andReturn(['as' => 'test.root.match', 'module' => 'module/pluginB@page']);
     $dummyItem = m::mock('Xpressengine\\Menu\\MenuItem');
     $route->shouldReceive('uri')->andReturn('freeboard');
     $route->shouldReceive('setAction')->andReturn($route);
     $menuHandler->shouldReceive('getItem')->andReturn($dummyItem);
     $menuHandler->shouldReceive('getMenuItemTheme')->andReturn('defaultTheme');
     $result = $moduleValidator->matches($route, $request);
     $this->assertEquals(true, $result);
 }
 /**
  * setUp
  *
  * @return void
  */
 protected function setUp()
 {
     /**
      * @var Route           $route
      * @var Request     $request
      */
     $route = m::mock('Illuminate\\Routing\\Route');
     $request = m::mock('Illuminate\\Http\\Request');
     $routeHandler = m::mock('Xpressengine\\Routing\\InstanceRouteHandler');
     $menuConfigHandler = m::mock('Xpressengine\\Menu\\MenuConfigHandler');
     $menuHandler = m::mock('Xpressengine\\Menu\\MenuRetrieveHandler');
     $themeHandler = m::mock('Xpressengine\\Theme\\ThemeHandler');
     $siteHandler = m::mock('Xpressengine\\Site\\SiteHandler');
     $this->routeHandler = $routeHandler;
     $this->menuConfigHandler = $menuConfigHandler;
     $this->menuHandler = $menuHandler;
     $this->themeHandler = $themeHandler;
     $this->siteHandler = $siteHandler;
     $instanceRoute = new InstanceRoute(['instanceId' => 'board', 'module' => 'module/xpressengine@board', 'url' => 'freeboard', 'menuId' => 'basic', 'site' => 'default']);
     $siteHandler->shouldReceive('getHomeInstanceId')->andReturn('board');
     $routeHandler->shouldReceive('getByInstanceId')->andReturn($instanceRoute);
     $moduleValidator = new ModuleValidator();
     $moduleValidator->boot($routeHandler, $menuHandler, $menuConfigHandler, $themeHandler, $siteHandler);
     $this->moduleValidator = $moduleValidator;
     $this->route = $route;
     $this->request = $request;
     parent::setUp();
 }