throw exception in nice_die during tests

Exits during testing will break the whole test suite. It makes more
sense to throw an exception in that case. The exception's stack trace
will help to debug the actual problem
This commit is contained in:
Andreas Gohr 2017-09-02 16:23:14 +02:00
parent 27c0c399d7
commit 3862da0e1f
1 changed files with 3 additions and 0 deletions

View File

@ -527,6 +527,9 @@ function nice_die($msg){
</body>
</html>
EOT;
if(defined('DOKU_UNITTEST')) {
throw new RuntimeException('nice_die: '.$msg);
}
exit(1);
}