Affects Version/s: 3.10
Fix Version/s: None
Component/s: Unit tests
The test_context_not_used() unit test is really strange, but that's normally not detected because the test expects a notice and certainly gets it.
To reproduce it:
1) Edit lib/tests/event_test.php, go to the test_context_not_used() method and comment the line:
2) Run $ vendor/bin/phpunit --filter ::test_context_not_used
3 You will get:
The points here are:
a) Verify that really that's the notice the test is expecting, because it's a really strange one. Fix it if that's not the case.
b) Move the exception expectation to the correct place. Note that right now the notice happens in the 1st line after the expectation and that's strange because then... what's all the remaining code about? It's not reachable (the exception happens earlier).
And that's it. As said, the problem is masked because the test expects a notice/warning. This is just about to ensure that's the notice it is expecting and that there isn't trailing code after the notice happens.