/** * @covers Fracture\Http\Response::addHeader * @covers Fracture\Http\Response::getHeaders * @covers Fracture\Http\Response::setHostname * * @covers Fracture\Http\Response::populateHeaderList * @covers Fracture\Http\Response::adjustForHostname * * @dataProvider provideLocationHeaderAdditionWithHostnameSet */ public function testLocationHeaderAdditionWithHostnameSet($host, $path, $expected) { $headerMock = $this->getMock('Fracture\\Http\\Headers\\Location', ['getName', 'getValue']); $headerMock->expects($this->any())->method('getName')->will($this->returnValue('Location')); $headerMock->expects($this->any())->method('getValue')->will($this->returnValue($path)); $instance = new Response(); $instance->addHeader($headerMock); $instance->setHostname($host); $this->assertEquals([['value' => $expected, 'replace' => true]], $instance->getHeaders()); }