1 | <?php |
||
5 | final class TestResult |
||
6 | { |
||
7 | /** |
||
8 | * @var string Test category this test belongs to |
||
9 | */ |
||
10 | private $category; |
||
11 | |||
12 | /** |
||
13 | * @var string The subject that was tested |
||
14 | */ |
||
15 | private $subject; |
||
16 | |||
17 | /** |
||
18 | * @var string Message describing the result |
||
19 | */ |
||
20 | private $message; |
||
21 | |||
22 | /** |
||
23 | * @var array Data to be used by TestSuite or other TestCases |
||
24 | */ |
||
25 | private $output; |
||
26 | |||
27 | /** |
||
28 | * @var State The State object reflecting the result |
||
29 | */ |
||
30 | private $state = State::NOSTATE; |
||
31 | |||
32 | /** |
||
33 | * @param string $category |
||
34 | * @param string $subject |
||
35 | */ |
||
36 | public function __construct($category = 'Unknown category', $subject = 'Unknown subject') |
||
42 | |||
43 | /** |
||
44 | * @param State $state |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | public function setState($state = State::NOSTATE) |
||
53 | |||
54 | /** |
||
55 | * @return State |
||
56 | */ |
||
57 | public function getState() |
||
62 | |||
63 | /** |
||
64 | * @param string $message |
||
65 | * |
||
66 | * @return void |
||
67 | */ |
||
68 | public function setMessage($message) |
||
73 | |||
74 | |||
75 | /** |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getMessage() |
||
83 | |||
84 | /** |
||
85 | * @param array $value |
||
86 | * |
||
87 | * @return void |
||
88 | */ |
||
89 | public function setOutput($value) |
||
94 | |||
95 | /** |
||
96 | * @return array |
||
97 | */ |
||
98 | public function getOutput() |
||
103 | } |
||
104 |