public function testAuthFailsConnect()
{
$GLOBALS['cfg']['Server']['SignonSession'] = 'newSession';
$_COOKIE['newSession'] = '42';
$this->object = $this->getMockBuilder('PMA\\libraries\\plugins\\auth\\AuthenticationSignon')->disableOriginalConstructor()->setMethods(array('auth'))->getMock();
$this->object->expects($this->exactly(1))->method('auth');
$dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
$dbi->expects($this->at(0))->method('getError')->will($this->returnValue(null));
$GLOBALS['dbi'] = $dbi;
$this->object->authFails();
$this->assertEquals('Cannot log in to the MySQL server', $_SESSION['PMA_single_signon_error_message']);
}