Remove double %
[htmlpurifier.git] / tests / HTMLPurifier / SimpleTest / Reporter.php
blob85be1b77c0a3a328d41e758e217889c8c7c077f5
1 <?php
3 class HTMLPurifier_SimpleTest_Reporter extends HTMLReporter
6 protected $ac;
8 public function __construct($encoding, $ac)
10 $this->ac = $ac;
11 parent::__construct($encoding);
14 public function paintHeader($test_name)
16 parent::paintHeader($test_name);
18 <form action="" method="get" id="select">
19 <select name="f">
20 <option value="" style="font-weight:bold;"<?php if(!$this->ac['file']) {echo ' selected';} ?>>All Tests</option>
21 <?php foreach($GLOBALS['HTMLPurifierTest']['Files'] as $file) { ?>
22 <option value="<?php echo $file ?>"<?php
23 if ($this->ac['file'] == $file) echo ' selected';
24 ?>><?php echo $file ?></option>
25 <?php } ?>
26 </select>
27 <input type="checkbox" name="standalone" value="1" title="Standalone version?" <?php if($this->ac['standalone']) {echo 'checked="checked" ';} ?>/>
28 <input type="submit" value="Go">
29 </form>
30 <?php
31 flush();
34 public function paintFooter($test_name)
36 if (function_exists('xdebug_peak_memory_usage')) {
37 $max_mem = number_format(xdebug_peak_memory_usage());
38 echo "<div>Max memory usage: $max_mem bytes</div>";
40 parent::paintFooter($test_name);
43 protected function getCss()
45 $css = parent::getCss();
46 $css .= '
47 #select {position:absolute;top:0.2em;right:0.2em;}
49 return $css;
52 public function getTestList()
54 // hacky; depends on a specific implementation of paintPass, etc.
55 $list = parent::getTestList();
56 $testcase = $list[1];
57 if (class_exists($testcase, false)) $file = str_replace('_', '/', $testcase) . '.php';
58 else $file = $testcase;
59 $list[1] = '<a href="index.php?file=' . $file . '">' . $testcase . '</a>';
60 return $list;
65 // vim: et sw=4 sts=4