Ejemplo n.º 1
0
 /**
  * Controller callback can get URL, GET & POST params through its args.
  */
 public function testRequestAndRouteParam()
 {
     $r = new Router();
     $r->put('/basic/:id', function ($id, $name) {
         return new Response("{$name} {$id}");
     });
     $req = Request::create('/basic/42', 'PUT', ['id' => 41, 'name' => 'mOmonga']);
     $res = $r->run($req);
     $this->assertEquals(200, $res->getStatusCode());
     $this->assertEquals('mOmonga 42', $res->getContent());
 }