[ticket/13138] Fix the session key tests

PHPBB3-13138
[ticket/13138] Type hint the variables for IDE usage

PHPBB3-13138