ae13fc6bf32176b14be07c9d90035e6372047e78
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / Output / Statistics / StepStatV2.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 /**
14  * Second iteration of Behat step stat, with a scenario information.
15  *
16  * @author Konstantin Kudryashov <ever.zet@gmail.com>
17  */
18 final class StepStatV2 extends StepStat
19 {
20     /**
21      * @var string
22      */
23     private $scenarioTitle;
24     /**
25      * @var string
26      */
27     private $scenarioPath;
28     /**
29      * @var string
30      */
31     private $stepText;
32     /**
33      * @var string
34      */
35     private $stepPath;
36     /**
37      * @var integer
38      */
39     private $resultCode;
40     /**
41      * @var null|string
42      */
43     private $error;
44     /**
45      * @var null|string
46      */
47     private $stdOut;
48
49     /**
50      * Initializes step stat.
51      *
52      * @param string      $scenarioTitle
53      * @param string      $scenarioPath
54      * @param string      $stepText
55      * @param string      $stepPath
56      * @param integer     $resultCode
57      * @param null|string $error
58      * @param null|string $stdOut
59      */
60     public function __construct($scenarioTitle, $scenarioPath, $stepText, $stepPath, $resultCode, $error = null, $stdOut = null)
61     {
62         parent::__construct($stepText, $stepPath, $resultCode, $error, $stdOut);
63
64         $this->scenarioTitle = $scenarioTitle;
65         $this->scenarioPath = $scenarioPath;
66         $this->stepText = $stepText;
67         $this->stepPath = $stepPath;
68         $this->resultCode = $resultCode;
69         $this->error = $error;
70         $this->stdOut = $stdOut;
71     }
72
73     /**
74      * Returns associated scenario text.
75      *
76      * @return string
77      */
78     public function getScenarioText()
79     {
80         return $this->scenarioTitle;
81     }
82
83     /**
84      * Returns associated scenario path.
85      *
86      * @return string
87      */
88     public function getScenarioPath()
89     {
90         return $this->scenarioPath;
91     }
92
93     /**
94      * Returns step text.
95      *
96      * @return string
97      */
98     public function getStepText()
99     {
100         return $this->stepText;
101     }
102
103     /**
104      * Returns step path.
105      *
106      * @return string
107      */
108     public function getStepPath()
109     {
110         return $this->stepPath;
111     }
112
113     /**
114      * Returns step result code.
115      *
116      * @return integer
117      */
118     public function getResultCode()
119     {
120         return $this->resultCode;
121     }
122
123     /**
124      * Returns step error (if has one).
125      *
126      * @return null|string
127      */
128     public function getError()
129     {
130         return $this->error;
131     }
132
133     /**
134      * Returns step output (if has one).
135      *
136      * @return null|string
137      */
138     public function getStdOut()
139     {
140         return $this->stdOut;
141     }
142
143     /**
144      * Returns string representation for a stat.
145      *
146      * @return string
147      */
148     public function __toString()
149     {
150         return $this->getPath();
151     }
152 }