/**
  * Headers should be reset when you use setHttpHeaders.
  * @covers Agent::setHttpHeaders
  * @issue #144
  */
 public function testSetHttpHeaders()
 {
     $header1 = array('HTTP_PINK_PONY' => 'I secretly love ponies >_>');
     $md = new Agent($header1);
     $this->assertSame($md->getHttpHeaders(), $header1);
     $header2 = array('HTTP_FIRE_BREATHING_DRAGON' => 'yeah!');
     $md->setHttpHeaders($header2);
     $this->assertSame($md->getHttpHeaders(), $header2);
 }
예제 #2
0
 public function testLanguages()
 {
     $agent = new Agent();
     $agent->setHttpHeaders(array('HTTP_ACCEPT_LANGUAGE' => 'nl-NL,nl;q=0.8,en-US;q=0.6,en;q=0.4'));
     $this->assertEquals(array('nl-nl', 'nl', 'en-us', 'en'), $agent->languages());
 }
예제 #3
0
파일: _ide_helper.php 프로젝트: Quiss/Twiga
 /**
  * Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers.
  *
  * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract
  *                           the headers. The default null is left for backwards compatibilty.
  * @static 
  */
 public static function setHttpHeaders($httpHeaders = null)
 {
     //Method inherited from \Mobile_Detect
     return \Jenssegers\Agent\Agent::setHttpHeaders($httpHeaders);
 }