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 string $subject |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | public function setSubject($value) |
||
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getSubject() |
||
62 | |||
63 | /** |
||
64 | * @param string $category |
||
65 | * |
||
66 | * @return void |
||
67 | */ |
||
68 | public function setCategory($value) |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getCategory() |
||
82 | |||
83 | /** |
||
84 | * @param string $message |
||
85 | * |
||
86 | * @return void |
||
87 | */ |
||
88 | public function setMessage($message) |
||
93 | |||
94 | /** |
||
95 | * @return string |
||
96 | */ |
||
97 | public function getMessage() |
||
102 | |||
103 | /** |
||
104 | * @param array $value |
||
105 | * |
||
106 | * @return void |
||
107 | */ |
||
108 | public function setOutput($value) |
||
113 | |||
114 | /** |
||
115 | * @param string|null $key |
||
116 | * |
||
117 | * @return mixed |
||
118 | */ |
||
119 | public function getOutput($key = null) |
||
124 | |||
125 | /** |
||
126 | * @param State $state |
||
127 | * |
||
128 | * @return void |
||
129 | */ |
||
130 | public function setState($state = State::NOSTATE) |
||
135 | |||
136 | /** |
||
137 | * @return State |
||
138 | */ |
||
139 | public function getState() |
||
144 | } |
||
145 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.