[ticket/10714] Fix missing 8th argument in unit tests

PHPBB3-10714
[ticket/10714] Fix several doc blocks and comments

PHPBB3-10714
[ticket/10714] Cast values to integer before using them in the query

PHPBB3-10714
[ticket/10714] Fix more comments

PHPBB3-10714
[ticket/10714] Add getter for is_in_admin and use it

PHPBB3-10714