protected function getDebugOutput($testrun, $body, $request, $relaystate, $response)
{
$sb = 'NA';
if (preg_match('|<body.*?>(.*?)</body>|is', $body, $matches)) {
$sb = strip_tags($matches[1], '<p><span><div><table><tr><td><ul><li><ol><dd><dt><dl><code><pre>');
}
$html = '<div class="debugoutput">
<p>AuthnRequest:</p>
<div><pre class="debugbox"><code>' . htmlspecialchars(SimpleSAML_Utilities::formatXMLString($request)) . '</code></pre></div>
<p>RelayState:</p>
<div><pre class="debugbox"><code>' . var_export($relaystate, TRUE) . '</div>
<p>Response:</p>
<div><pre class="debugbox"><code>' . htmlspecialchars(SimpleSAML_Utilities::formatXMLString($response)) . '</code></pre></div>
<p>Resulting output from web page:</p>
<div class="htmlout">' . $sb . '</div>
</div>
';
#echo '<div>' . $html . '</div>'; exit;
return $html;
}