Exemplo n.º 1
0
 public function __construct(array $get = null, array $post = null, array $cookies = null, array $files = null, array $server = null)
 {
     $get = $get ?? $_GET;
     $post = $post ?? $_POST;
     $cookies = $cookies ?? $_COOKIE;
     $files = $files ?? $_FILES;
     $server = $server ?? $_SERVER;
     if (preg_match('~^application/json~i', $server['HTTP_CONTENT_TYPE'] ?? $server['CONTENT_TYPE'] ?? null)) {
         //for AngularJS handling
         $post = array_merge($post ?? [], (array) json_decode(trim($this->getRawInput()), true));
         $this->ajax = true;
     }
     parent::__construct($get, $post, $cookies, $files, $server);
 }
 /**
  * @expectedException Http\MissingRequestMetaVariableException
  */
 public function testGetQueryStringException()
 {
     $request = new HttpRequest([], [], [], [], []);
     $request->getQueryString();
 }