Commit | Line | Data |
---|---|---|
f03dc6b0 TO |
1 | <?php |
2 | namespace Civi\CiUtil; | |
3 | ||
4 | class ComparisonPrinter { | |
5 | var $headers; | |
6 | var $hasHeader = FALSE; | |
7 | ||
00be9182 | 8 | public function __construct($headers) { |
f03dc6b0 TO |
9 | $this->headers = $headers; |
10 | } | |
11 | ||
00be9182 | 12 | public function printHeader() { |
f03dc6b0 TO |
13 | if ($this->hasHeader) { |
14 | return; | |
15 | } | |
16 | ||
17 | ## LEGEND | |
18 | print "LEGEND\n"; | |
19 | $i = 1; | |
20 | foreach ($this->headers as $header) { | |
21 | printf("% 2d: %s\n", $i, $header); | |
22 | $i++; | |
23 | } | |
24 | print "\n"; | |
25 | ||
26 | ## HEADER | |
27 | printf("%-90s ", 'TEST NAME'); | |
28 | $i = 1; | |
29 | foreach ($this->headers as $header) { | |
30 | printf("%-10d ", $i); | |
31 | $i++; | |
32 | } | |
33 | print "\n"; | |
34 | ||
35 | $this->hasHeader = TRUE; | |
36 | } | |
37 | ||
00be9182 | 38 | public function printRow($test, $values) { |
f03dc6b0 TO |
39 | $this->printHeader(); |
40 | printf("%-90s ", $test); | |
41 | foreach ($values as $value) { | |
42 | printf("%-10s ", $value); | |
43 | } | |
44 | print "\n"; | |
45 | } | |
96025800 | 46 | |
ef10e0b5 | 47 | } |