1 | <?php |
||
13 | class Report |
||
14 | { |
||
15 | /** |
||
16 | * Name of the tested ambient |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | private $name; |
||
21 | |||
22 | /** |
||
23 | * Total of assertions executed |
||
24 | * |
||
25 | * @var integer |
||
26 | */ |
||
27 | private $total = 0; |
||
28 | |||
29 | /** |
||
30 | * Total of successful assertions |
||
31 | * |
||
32 | * @var integer |
||
33 | */ |
||
34 | private $successTotal = 0; |
||
35 | |||
36 | /** |
||
37 | * Total of unsuccessful assertions |
||
38 | * |
||
39 | * @var integer |
||
40 | */ |
||
41 | private $failTotal = 0; |
||
42 | |||
43 | /** |
||
44 | * Executed assertions details |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | private $assertList = []; |
||
49 | |||
50 | public function __construct($name) |
||
54 | |||
55 | /** |
||
56 | * Returns the name of the tested ambient |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getName() |
||
64 | |||
65 | /** |
||
66 | * Adds an assert to assert list |
||
67 | * |
||
68 | * @param \Gabrieljmj\Should\Report\AssertReport $report |
||
69 | */ |
||
70 | public function addAssert(AssertReport $report) |
||
76 | |||
77 | /** |
||
78 | * Returns the total of assertions executed |
||
79 | * |
||
80 | * @return integer |
||
81 | */ |
||
82 | public function getTotal() |
||
86 | |||
87 | /** |
||
88 | * Returns the total of successful assertions |
||
89 | * |
||
90 | * @return integer |
||
91 | */ |
||
92 | public function getSuccessTotal() |
||
96 | |||
97 | /** |
||
98 | * Return the total of unsuccessful assertions |
||
99 | * |
||
100 | * @return integer |
||
101 | */ |
||
102 | public function getFailTotal() |
||
106 | |||
107 | /** |
||
108 | * Returns the executed assertions |
||
109 | * Each array element is an instance of \Gabrieljmj\Should\Report\ReportAssertion |
||
110 | * |
||
111 | * @return array |
||
112 | */ |
||
113 | public function getAssertList() |
||
117 | |||
118 | /** |
||
119 | * Serializes the report |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | public function serialize() |
||
149 | |||
150 | /** |
||
151 | * Unserializes a string of a report |
||
152 | * |
||
153 | * @param string $str |
||
154 | */ |
||
155 | public function unserialize($str) |
||
159 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.