I found a bug, and it didn't show in the details-section of the testcase the HTML, instead the browser parsed the HTML.
So I added htmlentities(), and later is saw there's already a $this->_htmlEntities() so I used that instead.
Here my patch.
--- a/tests/simpletest/extensions/my_reporter.php
+++ b/tests/simpletest/extensions/my_reporter.php
@@ -187,7 +187,7 @@ class MyReporter extends SimpleReporter {
<div class="result">PASSED</div>
<h3>'.$test.'</h3>
<div class="details">
- <em>'.$message.'</em>
+ <em>'.$this->_htmlEntities($message).'</em>
</div>
</div>
';
@@ -211,7 +211,7 @@ class MyReporter extends SimpleReporter {
<div class="result">FAILED</div>
<h3>'.$test.'</h3>
<div class="details">
- <em>'.$message.'</em>
+ <em>'.$this->_htmlEntities($message).'</em>
</div>
</div>
';