$request->headers->
set('Accept-Charset', 'ISO-8859-1, US-ASCII, UTF-8; q=0.8, ISO-10646-UCS-2; q=0.6'
);
$this->
assertEquals(['ISO-8859-1', 'US-ASCII', 'UTF-8', 'ISO-10646-UCS-2'
],
$request->
getCharsets());
$request =
new Request();
$request->headers->
set('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
);
$this->
assertEquals(['ISO-8859-1', 'utf-8', '*'
],
$request->
getCharsets());
} public function testGetEncodings() { $request =
new Request();
$this->
assertEquals([],
$request->
getEncodings());
$request->headers->
set('Accept-Encoding', 'gzip,deflate,sdch'
);
$this->
assertEquals([],
$request->
getEncodings()); // testing caching
$request =
new Request();
$request->headers->
set('Accept-Encoding', 'gzip,deflate,sdch'
);
$this->
assertEquals(['gzip', 'deflate', 'sdch'
],
$request->
getEncodings());
$request =
new Request();
$request->headers->
set('Accept-Encoding', 'gzip;q=0.4,deflate;q=0.9,compress;q=0.7'
);
$this->
assertEquals(['deflate', 'compress', 'gzip'
],
$request->
getEncodings());
}