public function setUp()
 {
     $this->router = $router = new TreeRouteStack();
     $route = new Segment('/resource[/[:id]]');
     $router->addRoute('resource', $route);
     $route2 = new Segment('/help');
     $router->addRoute('docs', $route2);
     $router->addRoute('hostname', array('type' => 'hostname', 'options' => array('route' => 'localhost.localdomain'), 'child_routes' => array('resource' => array('type' => 'segment', 'options' => array('route' => '/resource[/:id]'), 'may_terminate' => true, 'child_routes' => array('children' => array('type' => 'literal', 'options' => array('route' => '/children')))), 'users' => array('type' => 'segment', 'options' => array('route' => '/users[/:id]')), 'contacts' => array('type' => 'segment', 'options' => array('route' => '/contacts[/:id]')), 'embedded' => array('type' => 'segment', 'options' => array('route' => '/embedded[/:id]')), 'embedded_custom' => array('type' => 'segment', 'options' => array('route' => '/embedded_custom[/:custom_id]')))));
     $this->event = $event = new MvcEvent();
     $event->setRouter($router);
     $router->setRequestUri(new Http('http://localhost.localdomain/resource'));
     $controller = $this->controller = $this->getMock('PhlyRestfully\\ResourceController');
     $controller->expects($this->any())->method('getEvent')->will($this->returnValue($event));
     $this->urlHelper = $urlHelper = new UrlHelper();
     $urlHelper->setRouter($router);
     $this->serverUrlHelper = $serverUrlHelper = new ServerUrlHelper();
     $serverUrlHelper->setScheme('http');
     $serverUrlHelper->setHost('localhost.localdomain');
     $this->plugin = $plugin = new HalLinks();
     $plugin->setController($controller);
     $plugin->setUrlHelper($urlHelper);
     $plugin->setServerUrlHelper($serverUrlHelper);
 }