4 * This file is part of the Behat.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Behat\Output\Statistics;
14 * Second iteration of Behat step stat, with a scenario information.
16 * @author Konstantin Kudryashov <ever.zet@gmail.com>
18 final class StepStatV2 extends StepStat
23 private $scenarioTitle;
27 private $scenarioPath;
50 * Initializes step stat.
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
60 public function __construct($scenarioTitle, $scenarioPath, $stepText, $stepPath, $resultCode, $error = null, $stdOut = null)
62 parent::__construct($stepText, $stepPath, $resultCode, $error, $stdOut);
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;
74 * Returns associated scenario text.
78 public function getScenarioText()
80 return $this->scenarioTitle;
84 * Returns associated scenario path.
88 public function getScenarioPath()
90 return $this->scenarioPath;
98 public function getStepText()
100 return $this->stepText;
108 public function getStepPath()
110 return $this->stepPath;
114 * Returns step result code.
118 public function getResultCode()
120 return $this->resultCode;
124 * Returns step error (if has one).
126 * @return null|string
128 public function getError()
134 * Returns step output (if has one).
136 * @return null|string
138 public function getStdOut()
140 return $this->stdOut;
144 * Returns string representation for a stat.
148 public function __toString()
150 return $this->getPath();