Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / Output / Statistics / PhaseStatistics.php
1 <?php
2
3 /*
4  * This file is part of the Behat.
5  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 namespace Behat\Behat\Output\Statistics;
12
13 use Behat\Testwork\Counter\Timer;
14 use Behat\Testwork\Counter\Memory;
15
16 /**
17  * A TotalStatistics decorator to get statistics per phase.
18  *
19  * This is useful to show the amount of failures
20  * in a single suite for instance.
21  *
22  * @author Wouter J <wouter@wouterj.nl>
23  */
24 final class PhaseStatistics implements Statistics
25 {
26     /**
27      * @var TotalStatistics
28      */
29     private $statistics;
30
31     public function __construct()
32     {
33         $this->statistics = new TotalStatistics();
34     }
35
36     /**
37      * Resets the statistics.
38      */
39     public function reset()
40     {
41         $this->statistics = new TotalStatistics();
42     }
43
44     /**
45      * Starts timer.
46      */
47     public function startTimer()
48     {
49         $this->statistics->startTimer();
50     }
51
52     /**
53      * Stops timer.
54      */
55     public function stopTimer()
56     {
57         $this->statistics->stopTimer();
58     }
59
60     /**
61      * Returns timer object.
62      *
63      * @return Timer
64      */
65     public function getTimer()
66     {
67         return $this->statistics->getTimer();
68     }
69
70     /**
71      * Returns memory usage object.
72      *
73      * @return Memory
74      */
75     public function getMemory()
76     {
77         return $this->statistics->getMemory();
78     }
79
80     /**
81      * Registers scenario stat.
82      *
83      * @param ScenarioStat $stat
84      */
85     public function registerScenarioStat(ScenarioStat $stat)
86     {
87         $this->statistics->registerScenarioStat($stat);
88     }
89
90     /**
91      * Registers step stat.
92      *
93      * @param StepStat $stat
94      */
95     public function registerStepStat(StepStat $stat)
96     {
97         $this->statistics->registerStepStat($stat);
98     }
99
100     /**
101      * Registers hook stat.
102      *
103      * @param HookStat $stat
104      */
105     public function registerHookStat(HookStat $stat)
106     {
107         $this->statistics->registerHookStat($stat);
108     }
109
110     /**
111      * Returns counters for different scenario result codes.
112      *
113      * @return array[]
114      */
115     public function getScenarioStatCounts()
116     {
117         return $this->statistics->getScenarioStatCounts();
118     }
119
120     /**
121      * Returns skipped scenario stats.
122      *
123      * @return ScenarioStat[]
124      */
125     public function getSkippedScenarios()
126     {
127         return $this->statistics->getSkippedScenarios();
128     }
129
130     /**
131      * Returns failed scenario stats.
132      *
133      * @return ScenarioStat[]
134      */
135     public function getFailedScenarios()
136     {
137         return $this->statistics->getFailedScenarios();
138     }
139
140     /**
141      * Returns counters for different step result codes.
142      *
143      * @return array[]
144      */
145     public function getStepStatCounts()
146     {
147         return $this->statistics->getStepStatCounts();
148     }
149
150     /**
151      * Returns failed step stats.
152      *
153      * @return StepStat[]
154      */
155     public function getFailedSteps()
156     {
157         return $this->statistics->getFailedSteps();
158     }
159
160     /**
161      * Returns pending step stats.
162      *
163      * @return StepStat[]
164      */
165     public function getPendingSteps()
166     {
167         return $this->statistics->getPendingSteps();
168     }
169
170     /**
171      * Returns failed hook stats.
172      *
173      * @return HookStat[]
174      */
175     public function getFailedHookStats()
176     {
177         return $this->statistics->getFailedHookStats();
178     }
179 }