diff --git a/_test/bootstrap.php b/_test/bootstrap.php
index 58ad6a0d7d9cbf84ca4614c7237f7e001f836760..310b3627a28053cec64588c90027c21cc40a897e 100644
--- a/_test/bootstrap.php
+++ b/_test/bootstrap.php
@@ -110,3 +110,7 @@ $dh->close();
 // load dw
 require_once(DOKU_INC.'inc/init.php');
 
+// load the parser so $PARSER_MODES is defined before the tests start
+// otherwise PHPUnit unsets $PARSER_MODES in some cases which breaks p_get_parsermodes()
+require_once(DOKU_INC.'inc/parser/parser.php');
+