Пример #1
0
 /**
  * @covers \Cougar\RestService\RestService::header
  */
 public function testHeader()
 {
     $this->assertEquals("localhost", $this->object->header("Host"));
     $this->assertEquals("Sample user agent", $this->object->header("User-Agent"));
     $this->assertEquals("Sample user agent", $this->object->header("USER-AGENT"));
     $this->assertEquals("Sample user agent", $this->object->header("user-agent"));
     $this->assertEquals("Sample user agent", $this->object->header("user-Agent"));
     #$this->assertEquals("text/html,application/xhtml+xml," .
     #        "application/xml;q=0.9,*/*;q=0.8",
     #    $this->object->header("Accept"));
     $this->assertEquals("application/json;version=2,application/json," . "application/xml;q=0.8,text/html;q=0.5", $this->object->header("Accept"));
     $this->assertEquals(0, $this->object->header("Host", "int"));
     $this->assertEquals(0.0, $this->object->header("Host", "float"));
     $this->assertEquals(false, $this->object->header("Host", "bool"));
     $this->assertEquals("localhost", $this->object->header("Host", "string", "no value"));
     $this->assertEquals("no value", $this->object->header("does not exist", "string", "no value"));
 }