-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.10, 4.2.7, 4.3.4, 4.4
It has been detected that, sometimes (MDL-80418 with a deprecate string use, to be fixed by MDL-80839), when debugging is being output as part of unit tests, the output is not detected and PHPUnit ends normally, without any risky test or warning allowing us to detect it.
pholden detected that it only happens when the test is a basic_testcase and, when the test is an advanced_testcase then the PHPUnit execution fails properly (with "Unexpected debugging() call detected" message).
Tracing down the problem... the is that we are *semi-using* the debugging sink for all tests, when we should use it only for advanced_testcase and database_driver_testcase (the ones supporting the sink). And, later, other tests, that don't support the sink, fail to report the error above.
So, what we have to do is to ensure that the *semi-using* the debugging sink doesn't happen any more and:
- advanced_testcase and database_driver_testcase: They both store and report what is found in the debugging sink (current behaviour, no change).
- basic_testcase: Will stop storing anything in the debugging sink (change) because later it's not reporting (current behaviour).
That way, any basic_testcase emitting any debugging message just will be detected as a risky tests by PHPUnit itself, because we run tests with beStrictAboutOutputDuringTests enabled. And, once detected by PHPUnit we can decide to fail the run or whatever.
So, TL;DR; keep non advanced_testcase and non database_driver_testcase tests completely out from the debugging sink, because right now we are semi-using it and that's leading to problems (debugging) to be detected.