From 0c313f7823f6b43dd546221b81e0e22613a04d23 Mon Sep 17 00:00:00 2001 From: Michael Hamann <michael@content-space.de> Date: Tue, 2 Oct 2012 00:23:22 +0200 Subject: [PATCH] Always load the parser in the test environment This fixes the problem that $PARSER_MODES was sometimes unset by PHPUnit between test functions that called p_get_parsermodes() as PHPUnit tried to restore the global environment. I couldn't reproduce this when I executed all tests but just when I executed a single plugin test. --- _test/bootstrap.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_test/bootstrap.php b/_test/bootstrap.php index 58ad6a0d7..310b3627a 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'); + -- GitLab