1 | <?php |
||
13 | class TestCase |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | public $name; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | public $class; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | public $file; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | public $line; |
||
34 | |||
35 | /** |
||
36 | * @var int |
||
37 | */ |
||
38 | public $assertions; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | public $time; |
||
44 | |||
45 | /** |
||
46 | * Number of failures in this test case |
||
47 | * |
||
48 | * @var array |
||
49 | */ |
||
50 | public $failures = []; |
||
51 | |||
52 | /** |
||
53 | * Number of errors in this test case |
||
54 | * TODO: Not a number? |
||
55 | * |
||
56 | * @var array |
||
57 | */ |
||
58 | public $errors = []; |
||
59 | |||
60 | public $skipped = []; |
||
61 | |||
62 | 54 | public function __construct( |
|
77 | |||
78 | /** |
||
79 | * @param string $type |
||
80 | * @param string $text |
||
81 | */ |
||
82 | 48 | public function addFailure($type, $text) |
|
86 | |||
87 | /** |
||
88 | * @param string $type |
||
89 | * @param string $text |
||
90 | */ |
||
91 | 49 | public function addError($type, $text) |
|
95 | |||
96 | /** |
||
97 | * @param string $type |
||
98 | * @param string $text |
||
99 | */ |
||
100 | public function addSkipped($type, $text) |
||
104 | |||
105 | /** |
||
106 | * Add a defect type (error or failure) |
||
107 | * |
||
108 | * @param string $collName the name of the collection to add to |
||
109 | * @param $type |
||
110 | * @param $text |
||
111 | */ |
||
112 | 49 | protected function addDefect($collName, $type, $text) |
|
119 | |||
120 | /** |
||
121 | * Add systemOut result on test (if has failed or have error) |
||
122 | * |
||
123 | * @param mixed $node |
||
124 | * @return mixed |
||
125 | */ |
||
126 | 54 | public static function addSystemOut($node) |
|
140 | |||
141 | /** |
||
142 | * Factory method that creates a TestCase object |
||
143 | * from a SimpleXMLElement |
||
144 | * |
||
145 | * @param \SimpleXMLElement $node |
||
146 | * @return TestCase |
||
147 | */ |
||
148 | 54 | public static function caseFromNode(\SimpleXMLElement $node) |
|
179 | } |
||
180 |