Beispiel #1
0
 /**
  * Gets the request user agent
  *
  * @return string
  */
 public function userAgent()
 {
     return $this->headers->get('USER_AGENT');
 }
 public function testNameNormalizing()
 {
     // Test data
     $data = array('DOG_NAME' => 'cooper');
     // Create our collection with NO data
     $normalized_key = HeaderDataCollection::normalizeName(key($data));
     $normalized_val = HeaderDataCollection::normalizeName(current($data));
     $this->assertNotSame(key($data), $normalized_key);
     $this->assertSame(current($data), $normalized_val);
     $normalized_key_without_case_change = HeaderDataCollection::normalizeName(key($data), false);
     $this->assertTrue(strpos($normalized_key_without_case_change, 'D') !== false);
     $this->assertTrue(strpos($normalized_key_without_case_change, 'd') === false);
     $this->assertTrue(strpos($normalized_key, 'd') !== false);
     $this->assertTrue(strpos($normalized_key, 'D') === false);
 }
 /**
  * Sets a response header
  *
  * @param string $key The name of the HTTP response header
  * @param mixed $value The value to set the header with
  * @return $this
  */
 public function header($key, $value)
 {
     $this->headers->set($key, $value);
     return $this;
 }