[ticket/11618] Replace glob() with scandir() and string matching

Removes glob from template tests as glob() does not work on all
systems according to PHP documentation as has been noticed by users.

PHPBB3-11618