public function doMockResponse()
{
$restoreInstance = PMA\libraries\Response::getInstance();
// set mocked headers and footers
$mockResponse = $this->getMockBuilder('PMA\\libraries\\Response')->disableOriginalConstructor()->setMethods(array('header', 'headersSent'))->getMock();
$mockResponse->expects($this->any())->method('headersSent')->with()->will($this->returnValue(false));
$attrInstance = new ReflectionProperty('PMA\\libraries\\Response', '_instance');
$attrInstance->setAccessible(true);
$attrInstance->setValue($mockResponse);
$headers = func_get_args();
$header_method = $mockResponse->expects($this->exactly(count($headers)))->method('header');
call_user_func_array(array($header_method, 'withConsecutive'), $headers);
$this->object->authFails();
$attrInstance->setValue($restoreInstance);
}