/**
  * Sets main dynamic routing params into Slim app
  *
  * @param \Slim\App $app
  *
  * @return void
  */
 public static function setMap($app, $namespace)
 {
     $app->any('/{controller}[/{params:.*}]', function ($request, $response, $args) use($app, $namespace) {
         $contDI = $app->getContainer();
         // Get dependencies.
         // Get called method
         $method = strtolower($request->getMethod());
         // Get config namespace if necessary
         $calledController = $namespace . '\\' . $args['controller'];
         $controller = new $calledController();
         if (is_a($controller, "\\mbarquin\\SlimDR\\ControllerInterface") === false) {
             throw new \Exception('Controller must implement \\mbarquin\\SlimDR\\ControllerInterface');
         }
         $funcArgs = \mbarquin\SlimDR\Factory::getArgs($request, $response, $args, $contDI, $controller, $method);
         call_user_func_array(array($controller, $method), $funcArgs);
     });
 }
 /**
  * @covers mbarquin\SlimDR\Factory::__construct
  * @todo   Implement testSlim().
  */
 public function testSlimConstructWithApp()
 {
     $slim = new \Slim\App();
     $app = \mbarquin\SlimDR\Factory::slim($slim);
     $this->assertAttributeInstanceOf('\\Slim\\App', 'slimApp', $app);
 }