How to prevent a plugin bootstrap.php file to be loaded twice during tests?

I have defined some constants in my plugin bootstrap file and that generates some error messages when I unit test my plugin

.Notice Error: Constant THESIS_CERTIFICATE_GENERATED already defined in

The notices disappear if I move my constants in the app bootstrap.php file.

Any suggestions ?

I somewhat remember running into a similar situation when converting a CakePHP 2 project to 3 a long while ago, but don’t know the particular circumstances anymore. I think I just wrapped it in an if is not defined check and didn’t bother beyond that. The constant was exposed semantically in the code but it will never change. Good enough.

1 Like

right good enough, thanks