As the title says, only class methods starting with "assert" are ignored + simpletest walks higher up the debug_backtrace() to find the test case, method name, and code line that asserts something.
Currently, we see the method name and code line of _assertEqual() all over again; not very helpful.
FYI: Our improved assertEqual() did not go into D7 core, because it's an insane amount of work to manually update all assertEqual() invocations in all tests. That's one giant downside of writing plenty of tests. That said, DrupalWebTestCase in core should probably have an API version number appended, so test cases can choose between versions and upgrade/migrate over time, i.e., MollomTestCase extends DrupalWebTestCase1 - or similar. I'm no OOP expert.
Anyway, having to choose between a l33t-ish assertEqualXT() and an amusing assertSame(), I went for the latter ;)
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | mollom-HEAD.assertSame.12.patch | 12.24 KB | sun |
| #10 | mollom-HEAD.assertSame.10.patch | 12.2 KB | sun |
| #7 | mollom-DRUPAL-6--1.assertsame.7.patch | 11.14 KB | sun |
| mollom-DRUPAL-6--1.assertsame.0.patch | 9.45 KB | sun |
Comments
Comment #1
sunmollom-DRUPAL-6--1.assertsame.0.patch queued for re-testing.
Comment #3
dries commentedI'm OK with the more amusing assertSame(). Maybe it is wort extending the @todo with some more information so we remember why we went with this approach for the time being?
Comment #4
dries commentedI applied this patch and ran the tests locally. They pass for me too.
Comment #5
dries commentedI committed the patch to CVS HEAD. Hopefully the test was failing because another problem. Let's see ...
Comment #6
dries commentedSorry, I did not commit this patch -- I committed #487454: E-mails cannot be reported instead. This patch will need a reroll because of #487454.
Comment #7
sunImproved documentation/@todo and also fixed output escaping.
Comment #8
dries commentedCommitted #7 to DRUPAL-6--1. Moving to CVS HEAD.
Comment #9
sunComment #10
sunStraight port. Let's see.
Comment #12
sunBad idea: Blatantly copying D6 code ;)
Powered by Dreditor.
Comment #13
dries commentedVictory! Committed to CVS HEAD. Thanks.