I use the XmlReporter quite extensively in a test suite I've built around SimpleTest and 99% of the time it's awesome :) However, there are two situations I've come across where the XML produced cannot be parsed.
1. A component being tested sends debug output which contains invalid XML. I've worked around this by replacing any print_r()/var_dump()/echo() etc with SimpleTest::getContext()->getTest()->dump(). Generally speaking you rarely need to output anything directly from a component being tested, but for the odd case where it's needed could the reporter somehow use output buffering to capture any output and put in a CDATA block somewhere?
2. I'm working with code which deals with string comparisons on binary data. This binary is being output as part of the assertion/expectation messages which is causing the charset to be corrupt and therefore making the XML unparseable. I'm not sure if putting CDATA on *all* <pass>/<fail> etc tags would solve that but it would be nice to have a solution since it's pretty common you need to compare strings which aren't in the charset of the output XML. I could even manage with base64 encoding where needed for example:
<pass encoding="base64">Zm9vYmFy</pass>
Keep up the great work! :)
Logged In: YES
user_id=1195258
Originator: NO
Ah, we were just talking about this in the mailing list! I proposed a new assertIdenticalBinary() method; but autodetection by the reporter would also work nicely (and require no changes to your code).
Logged In: YES
user_id=1355972
Originator: YES
Ah, of course; that's the obvious solution! Compare hex and display as hex. I'll put my own implementation directly in the test case until it appears in CVS (or maybe SVN by then) :)
Logged In: YES
user_id=1355972
Originator: YES
I just hit another hurdle where the assertIdenticalBinary() method may fall over. When asserting that two arrays are equal with assertEqual(), some elements may contain binary data which then gets output in the XML.
Can array elements be set to Expectation objects like Mock arguments can? This would provide a suitable workaround.
I was wondering; even if this bug gets fixed, how would we test to make sure the fix worked (besides linting the XML output of visual_tests.php? Is that acceptable, perhaps?)