Improve signon-script example

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2014-05-09 18:06:42 +02:00
parent 616e732c37
commit 3eccb9eb26
2 changed files with 11 additions and 3 deletions

View File

@ -23,7 +23,15 @@
*/
function get_login_credentials($user)
{
return array('root', '');
/* Optionally we can use passed username */
if (!empty($user)) {
return array($user, 'password');
}
/* Here we would retrieve the credentials */
$credentials = array('root', '');
return $credentials;
}
?>

View File

@ -133,12 +133,12 @@ class PMA_AuthenticationSignon_Test extends PHPUnit_Framework_TestCase
);
$this->assertEquals(
'root',
'user',
$GLOBALS['PHP_AUTH_USER']
);
$this->assertEquals(
'',
'password',
$GLOBALS['PHP_AUTH_PW']
);