Example #1
0
 /**
  * Tests we can retrieve a specific service in the params of the controller
  */
 public function testCallWithServices()
 {
     $pattern = 'pattern';
     $controller = function (\stdClass $service1) {
         return func_get_args();
     };
     $matches = array(1, 2, 3);
     $services = new Container();
     $services['service1'] = function () {
         return new \stdClass();
     };
     $route = new Route(new RoutePattern($pattern), $controller);
     $route->setMatches($matches);
     $this->assertSame(array($services['service1']), $route->call($services));
 }