Now that the PDO is very close to land, we need to make sure that the testing framework can intercept uncaught exceptions.
Uncaught exceptions are fatal in some cases in PHP, an they can stop a test case completely (ie. the following test* methods will not get executed).
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 293521-simpletest-exceptions.patch | 1.55 KB | damien tournoud |
| #2 | simpletest-catch-exceptions-2.patch | 1.1 KB | damien tournoud |
| simpletest-catch-exceptions.patch | 899 bytes | damien tournoud |
Comments
Comment #1
chx commentedComment #2
damien tournoud commentedThe same, with a better backtracing.
Comment #3
boombatower commentedWhat are you considering fatal uncaught exceptions?
Adding
To a test causes a crash of batch process and redirect to page that informs me of an error that occurred.
Comment #4
damien tournoud commented@boombatower: we don't need to crash the batch process. We should handle that gracefully.
A cleanest patch is attached.
For those wondering what the
set_exception_handlercould be used for if we already run the tests in a try/catch block: in PHP it is 100% possible to throw an exception that is not a child of the Exception class. We catch those here. Silly, isn't it?Comment #5
damien tournoud commentedComment #6
boombatower commented@Damien Tournoud: I'm aware that we are trying to catch them gracefully, I was stating that it didn't catch them.
Comment #7
boombatower commentedIt still crashes if I add that code to any test.
Based on: "we don't need to crash the batch process. We should handle that gracefully." needs work?
Comment #8
boombatower commentedCatches:
If that is all we can/intend to catch this works.
Comment #9
boombatower commentedWould suggest that #250047: Rework the SimpleTest results interface and clean-up of backend code gets in so that the custom caller is not needed. (check that)
Comment #10
boombatower commentedCorrect me if I'm wrong, but I believe #305077: Rework simpletest backend has this functionality now.