[ticket/11531] Use abstract class for avatar tests and unify test cases

PHPBB3-11531