Exemplo n.º 1
0
 public function testDeleteOverride()
 {
     $r = new Request(array('SERVER_NAME' => 'www.example.org', 'SERVER_PORT' => 80, 'QUERY_STRING' => '', 'REQUEST_URI' => '/index.php/foo', 'SCRIPT_NAME' => '/index.php', 'PATH_INFO' => '/foo', 'REQUEST_METHOD' => 'POST'), array('_METHOD' => 'DELETE'));
     $s = new Service();
     $s->delete('/foo', function (Request $request) {
         return 'deleted';
     });
     $response = $s->run($r);
     $this->assertSame(array('HTTP/1.1 200 OK', 'Content-Type: text/html;charset=UTF-8', 'Content-Length: 7', '', 'deleted'), $response->toArray());
 }