[ticket/12503] Fix several errors in test suite

https://tracker.phpbb.com/browse/PHPBB3-12486
https://tracker.phpbb.com/browse/PHPBB3-12503
https://tracker.phpbb.com/browse/PHPBB3-12504