public function testAuthErrorAJAX()
{
$restoreInstance = PMA\libraries\Response::getInstance();
$mockResponse = $this->getMockBuilder('PMA\\libraries\\Response')->disableOriginalConstructor()->setMethods(array('isAjax', 'setRequestStatus', 'addJSON'))->getMock();
$mockResponse->expects($this->once())->method('isAjax')->with()->will($this->returnValue(true));
$mockResponse->expects($this->once())->method('setRequestStatus')->with(false);
$mockResponse->expects($this->once())->method('addJSON')->with('redirect_flag', '1');
$attrInstance = new ReflectionProperty('PMA\\libraries\\Response', '_instance');
$attrInstance->setAccessible(true);
$attrInstance->setValue($mockResponse);
$GLOBALS['conn_error'] = true;
$this->assertTrue($this->object->auth());
$attrInstance->setValue($restoreInstance);
}