Skip to content

Commit

Permalink
Add more testcase assertions to cover all cases
Browse files Browse the repository at this point in the history
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
  • Loading branch information
devenbansod committed Nov 21, 2016
1 parent 592caad commit 29c6cd3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libraries/server_privileges.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ function PMA_getHtmlForAuthPluginsDropdown(
}
} else {
$active_auth_plugins = array(
'mysql_native_password' => __('Native MySQL Authentication')
'mysql_native_password' => __('Native MySQL authentication')
);
}

Expand Down
30 changes: 29 additions & 1 deletion test/libraries/PMA_server_privileges_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2366,9 +2366,37 @@ function testPMAGetHtmlForAuthPluginsDropdown()
$actualHtml
);

/* Assertion 3 */
$actualHtml = PMA_getHtmlForAuthPluginsDropdown(
'mysql_native_password',
'new',
'old'
);
$this->assertEquals(
'<select name="authentication_plugin" '
. 'id="select_authentication_plugin"><option '
. 'value="mysql_native_password" selected="selected">'
. 'Native MySQL authentication</option></select>',
$actualHtml
);

$GLOBALS['dbi'] = $oldDbi;

/* Assertion 4 */
$actualHtml = PMA_getHtmlForAuthPluginsDropdown(
'mysql_native_password',
'change_pw',
'old'
);
$this->assertEquals(
'<select name="authentication_plugin" '
. 'id="select_authentication_plugin_cp"><option '
. 'value="mysql_native_password" selected="selected">'
. 'Native MySQL authentication</option></select>',
$actualHtml
);

// Restore old DBI
$GLOBALS['dbi'] = $oldDbi;
}

/**
Expand Down

0 comments on commit 29c6cd3

Please sign in to comment.