public static function createRouter(ContainerInterface $container) : Router { $router = new Router($container); if ($container->has(DispatcherContract::class)) { $router->setEventsDispatcher($container->get(DispatcherContract::class)); } return $router; }
public function setUp() { parent::setUp(); $name = (new ReflectionClass($this))->getShortName(); $router = new Router($this->mock(ContainerInterface::class)); $router->setCachePath(__DIR__ . '/../Cache/' . $name . '.cache'); $router->refreshCache(true); $this->definitions($router); $this->router = $router; }