1 | <?php |
||
19 | final class TestResult |
||
20 | { |
||
21 | public const FAIL = 'failed'; |
||
22 | public const SKIPPED = 'skipped'; |
||
23 | public const INCOMPLETE = 'incompleted'; |
||
24 | public const RISKY = 'risked'; |
||
25 | public const WARN = 'warnings'; |
||
26 | public const RUNS = 'pending'; |
||
27 | public const PASS = 'passed'; |
||
28 | |||
29 | /** |
||
30 | * @readonly |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | public $description; |
||
35 | |||
36 | /** |
||
37 | * @readonly |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | public $type; |
||
42 | |||
43 | /** |
||
44 | * @readonly |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | public $icon; |
||
49 | |||
50 | /** |
||
51 | * @readonly |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | public $color; |
||
56 | |||
57 | /** |
||
58 | * @readonly |
||
59 | * |
||
60 | * @var string|null |
||
61 | */ |
||
62 | public $warning; |
||
63 | |||
64 | /** |
||
65 | * Test constructor. |
||
66 | * |
||
67 | * @param string $warning |
||
68 | */ |
||
69 | private function __construct(string $description, string $type, string $icon, string $color, string $warning = null) |
||
77 | |||
78 | /** |
||
79 | * Creates a new test from the given test case. |
||
80 | */ |
||
81 | public static function fromTestCase(TestCase $testCase, string $type, string $warning = null): self |
||
91 | |||
92 | /** |
||
93 | * Get the test case description. |
||
94 | */ |
||
95 | public static function makeDescription(TestCase $testCase): string |
||
114 | |||
115 | /** |
||
116 | * Get the test case icon. |
||
117 | */ |
||
118 | public static function makeIcon(string $type): string |
||
137 | |||
138 | /** |
||
139 | * Get the test case color. |
||
140 | */ |
||
141 | public static function makeColor(string $type): string |
||
156 | } |
||
157 |