2007-01-19 23:26:15 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class HTMLPurifier_SimpleTest_Reporter extends HTMLReporter
|
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2008-01-07 00:17:49 +00:00
|
|
|
protected $ac;
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2008-01-07 00:17:49 +00:00
|
|
|
public function __construct($encoding, $ac) {
|
|
|
|
$this->ac = $ac;
|
2008-04-21 15:24:18 +00:00
|
|
|
parent::__construct($encoding);
|
2008-01-07 00:17:49 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2008-01-07 00:17:49 +00:00
|
|
|
public function paintHeader($test_name) {
|
2007-01-19 23:26:15 +00:00
|
|
|
parent::paintHeader($test_name);
|
|
|
|
?>
|
|
|
|
<form action="" method="get" id="select">
|
|
|
|
<select name="f">
|
2008-01-07 00:17:49 +00:00
|
|
|
<option value="" style="font-weight:bold;"<?php if(!$this->ac['file']) {echo ' selected';} ?>>All Tests</option>
|
2007-01-19 23:26:15 +00:00
|
|
|
<?php foreach($GLOBALS['HTMLPurifierTest']['Files'] as $file) { ?>
|
|
|
|
<option value="<?php echo $file ?>"<?php
|
2008-01-07 00:17:49 +00:00
|
|
|
if ($this->ac['file'] == $file) echo ' selected';
|
2007-01-19 23:26:15 +00:00
|
|
|
?>><?php echo $file ?></option>
|
|
|
|
<?php } ?>
|
|
|
|
</select>
|
2008-02-17 01:07:17 +00:00
|
|
|
<input type="checkbox" name="standalone" value="1" title="Standalone version?" <?php if($this->ac['standalone']) {echo 'checked="checked" ';} ?>/>
|
2007-01-19 23:26:15 +00:00
|
|
|
<input type="submit" value="Go">
|
|
|
|
</form>
|
|
|
|
<?php
|
|
|
|
flush();
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2008-05-23 16:43:24 +00:00
|
|
|
public function paintFooter($test_name) {
|
|
|
|
if (function_exists('xdebug_peak_memory_usage')) {
|
|
|
|
$max_mem = number_format(xdebug_peak_memory_usage());
|
|
|
|
echo "<div>Max memory usage: $max_mem bytes</div>";
|
|
|
|
}
|
|
|
|
parent::paintFooter($test_name);
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2008-04-14 19:19:48 +00:00
|
|
|
protected function getCss() {
|
|
|
|
$css = parent::getCss();
|
2007-01-19 23:26:15 +00:00
|
|
|
$css .= '
|
|
|
|
#select {position:absolute;top:0.2em;right:0.2em;}
|
|
|
|
';
|
|
|
|
return $css;
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-01-19 23:26:15 +00:00
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|