Пример #1
0
 /**
  * @dataProvider providerParseAccept
  */
 public function testParseAccept($expected, $value)
 {
     $result = Header::parseAccept($value);
     $this->assertEquals($expected, $result);
 }
Пример #2
0
 /**
  * Gets a list of languages acceptable by the client browser.
  * @return array Array with the language as key and the preferable order
  * as value
  */
 public function getAcceptLanguage()
 {
     if (isset($this->acceptLanguage)) {
         return $this->acceptLanguage;
     }
     $header = $this->getHeader(Header::HEADER_ACCEPT_LANGUAGE);
     if (!$header) {
         return $this->acceptLanguage = array();
     }
     return $this->acceptLanguage = Header::parseAccept($header);
 }