Remove duplicate code

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Remove more duplicate code

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Update tests

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Merge branch 'master' of github.com:phpmyadmin/phpmyadmin