Originally posted my question on the tracker here:
Has anyone had trouble with the NO_OUTPUT_BUFFERING setting in unit tests? This change removed the line from lib/phpunit/bootstrap.php which says
and it's then defined as false right after in lib/setup.php L250. Then my plugin's unit tests fail, because they expect NO_OUTPUT_BUFFERING to be true, as it used to be.
My plugin normally has an index.php page that sets NO_OUTPUT_BUFFERING to true, before instantiating a new object and running (it prints out a progress bar, which is why it wants this set to true). But in unit tests, we don't visit the index page before instantiating the object, and we can't set it anyway from inside the test.
Is there a way I can set this constant in the plugin and not with some kind of phpunit bootstrap.php hack? Or maybe these tests are just gonna have to be changed for this new version of moodle?
In the ticket, Andrew Nicols said: "Generally speaking your tests should not expect NO_OUTPUT_BUFFERING to be true and tests should not set constants."
So in that case it sounds like I might just remove this check from the unit tests and leave it at that.
Would appreciate any advice, thanks!