public function convert(Request $request)
 {
     $headers = $request->getHeaders();
     $keysMap = f\map_indexed(function ($v, $k) {
         return 'HTTP_' . $k;
     }, $headers);
     $server = f\rename_keys($headers, $keysMap);
     return SymfonyRequest::create($request->getUri(), $request->getMethod(), $request->getParameters(), $cookies = array(), $files = array(), $server, $request->getContent());
 }
Esempio n. 2
0
 public function testConstruction()
 {
     $method = 'POST';
     $uri = '/';
     $request = new Request($method, $uri);
     $this->assertSame($method, $request->getMethod());
     $this->assertSame($uri, $request->getUri());
     $this->assertSame(array(), $request->getHeaders());
     $this->assertSame(array(), $request->getParameters());
     $this->assertNull($request->getContent());
 }