/** @test */
 public function format_detection_xml()
 {
     $parser = new Parser();
     $_SERVER['HTTP_CONTENT_TYPE'] = "application/xml";
     $this->assertEquals('xml', $parser->getFormat());
     $_SERVER['HTTP_CONTENT_TYPE'] = "text/xml";
     $this->assertEquals('xml', $parser->getFormat());
 }
 /** @test */
 public function format_detection_json()
 {
     $parser = new Parser();
     $_SERVER['HTTP_CONTENT_TYPE'] = "application/json";
     $this->assertEquals('json', $parser->getFormat());
     $_SERVER['HTTP_CONTENT_TYPE'] = "application/x-javascript";
     $this->assertEquals('json', $parser->getFormat());
     $_SERVER['HTTP_CONTENT_TYPE'] = "text/javascript";
     $this->assertEquals('json', $parser->getFormat());
     $_SERVER['HTTP_CONTENT_TYPE'] = "text/x-javascript";
     $this->assertEquals('json', $parser->getFormat());
     $_SERVER['HTTP_CONTENT_TYPE'] = "text/x-json";
     $this->assertEquals('json', $parser->getFormat());
 }
 /** @test */
 public function format_detection_query_string()
 {
     $parser = new Parser();
     $_SERVER['HTTP_CONTENT_TYPE'] = "application/x-www-form-urlencoded";
     $this->assertEquals('querystr', $parser->getFormat());
 }
 /** @test */
 public function format_detection_bson()
 {
     $parser = new Parser();
     $_SERVER['HTTP_CONTENT_TYPE'] = "application/bson";
     $this->assertEquals('bson', $parser->getFormat());
 }
 /** @test */
 public function format_detection_serialized()
 {
     $parser = new Parser();
     $_SERVER['HTTP_CONTENT_TYPE'] = "application/vnd.php.serialized";
     $this->assertEquals('serialize', $parser->getFormat());
 }
 /** @test */
 public function format_detection_defaults_to_json()
 {
     $parser = new Parser();
     $_SERVER['HTTP_CONTENT_TYPE'] = "somerandomstuff";
     $this->assertEquals('json', $parser->getFormat());
     $_SERVER['CONTENT_TYPE'] = "somerandomstuff";
     $this->assertEquals('json', $parser->getFormat());
 }