1 | <?php |
||
13 | class Presenter |
||
14 | { |
||
15 | /** |
||
16 | * @var OutputInterface |
||
17 | */ |
||
18 | protected $output; |
||
19 | |||
20 | /** |
||
21 | * @var integer The number of processed files |
||
22 | */ |
||
23 | private $fileCount = 0; |
||
24 | |||
25 | /** |
||
26 | * @var integer The number of assertions |
||
27 | */ |
||
28 | private $assertionCount = 0; |
||
29 | |||
30 | /** |
||
31 | * @var integer The number of failed assertions |
||
32 | */ |
||
33 | private $failureCount = 0; |
||
34 | |||
35 | public function __construct(OutputInterface $output) |
||
39 | |||
40 | /** |
||
41 | * Called when a new test run starts |
||
42 | */ |
||
43 | public function begin() |
||
47 | |||
48 | /** |
||
49 | * Called when a bootstrap has ben pulled |
||
50 | */ |
||
51 | public function bootstrap(string $bootstrap) |
||
55 | |||
56 | /** |
||
57 | * Called when a test run ends |
||
58 | */ |
||
59 | public function end() |
||
75 | |||
76 | /** |
||
77 | * Called when a new file is tested |
||
78 | */ |
||
79 | public function beginFile(string $fileName) |
||
84 | |||
85 | /** |
||
86 | * Called when an assertion is tested |
||
87 | */ |
||
88 | public function beginAssertion(string $exampleName, ReturnObj $returnObj) |
||
100 | |||
101 | /** |
||
102 | * Check if any failures have been recorded |
||
103 | */ |
||
104 | public function hasFailures(): bool |
||
108 | |||
109 | /** |
||
110 | * Called when an assertion is successfull |
||
111 | */ |
||
112 | protected function success(string $exampleName, string $message) |
||
115 | |||
116 | /** |
||
117 | * Called when an assertion failes |
||
118 | */ |
||
119 | protected function failure(string $exampleName, string $message) |
||
123 | } |
||
124 |