getHeader() public method

This method returns all of the header values of the given case-insensitive header name as a string concatenated together using a comma.
public getHeader ( string $header ) : string
$header string case-insensitive header name.
return string
示例#1
0
 /**
  * @covers \Bluz\Response\Response::addHeader
  * @covers \Bluz\Response\Response::getHeader
  * @covers \Bluz\Response\Response::getHeaderAsArray
  */
 public function testAddHeader()
 {
     $this->response->addHeader('foo', 'bar');
     $this->response->addHeader('foo', 'baz');
     $this->assertTrue($this->response->hasHeader('foo'));
     $this->assertEquals('bar, baz', $this->response->getHeader('foo'));
     $this->assertEqualsArray(['bar', 'baz'], $this->response->getHeaderAsArray('foo'));
     $this->assertEqualsArray([], $this->response->getHeaderAsArray('baz'));
 }