phpunit hides itself from stacktraces it prints. This becomes a nuisance when one has to hunt down setup/teardown calls inside of phpunit (http://tracker.phpbb.com/browse/PHPBB3-10551).
By defining a constant it is possible to stop phpunit from messing with the backtraces. No idea which versions this constant works for and/or if it is part of the published api.
and apparently test_config.php is included multiple times in a single run, hence the if check.