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\Node\Printer\Helper;
13 use Behat\Behat\Tester\Result\StepResult;
14 use Behat\Testwork\Tester\Result\TestResult;
17 * Converts result objects into a string representation.
19 * @author Konstantin Kudryashov <ever.zet@gmail.com>
21 final class ResultToStringConverter
24 * Converts provided test result to a string.
26 * @param TestResult $result
30 public function convertResultToString(TestResult $result)
32 return $this->convertResultCodeToString($result->getResultCode());
36 * Converts provided result code to a string.
38 * @param integer $resultCode
42 public function convertResultCodeToString($resultCode)
44 switch ($resultCode) {
45 case TestResult::SKIPPED:
47 case TestResult::PENDING:
49 case TestResult::FAILED:
51 case StepResult::UNDEFINED: