1 | <?php |
||
13 | class DelegatingListener implements TestListener |
||
14 | { |
||
15 | /** TestListener[] */ |
||
16 | private $listenerList = []; |
||
17 | |||
18 | /** |
||
19 | * {@inheritdoc} |
||
20 | */ |
||
21 | 10 | public function addListener(TestListener $listener) |
|
22 | { |
||
23 | 10 | $this->listenerList[] = $listener; |
|
24 | 10 | } |
|
25 | |||
26 | /** |
||
27 | * @return TestListener[] |
||
28 | */ |
||
29 | 1 | public function getListenerList() |
|
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | 1 | public function addError(Test $test, \Exception $e, $time) |
|
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | public function addWarning(Test $test, Warning $e, $time) |
||
48 | { |
||
49 | foreach ($this->listenerList as $listener) { |
||
50 | $listener->addWarning($test, $e, $time); |
||
51 | } |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 1 | public function addFailure(Test $test, AssertionFailedError $e, $time) |
|
58 | { |
||
59 | 1 | foreach ($this->listenerList as $listener) { |
|
60 | 1 | $listener->addFailure($test, $e, $time); |
|
61 | } |
||
62 | 1 | } |
|
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | 1 | public function addIncompleteTest(Test $test, \Exception $e, $time) |
|
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | 1 | public function addRiskyTest(Test $test, \Exception $e, $time) |
|
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | 1 | public function addSkippedTest(Test $test, \Exception $e, $time) |
|
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | 1 | public function startTestSuite(TestSuite $suite) |
|
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | 1 | public function endTestSuite(TestSuite $suite) |
|
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | 1 | public function startTest(Test $test) |
|
123 | |||
124 | /** |
||
125 | * {@inheritdoc} |
||
126 | */ |
||
127 | 1 | public function endTest(Test $test, $time) |
|
133 | } |
||
134 |