1 | <?php |
||
16 | class AssertReport |
||
17 | { |
||
18 | /** |
||
19 | * Assert type (class, property, method etc) |
||
20 | * Use constants from \Gabrieljmj\Should\Report\AssertType |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | private $type; |
||
25 | |||
26 | /** |
||
27 | * Assert |
||
28 | * |
||
29 | * @var \Gabrieljmj\Should\Assert\AssertInterface |
||
30 | */ |
||
31 | private $assert; |
||
32 | |||
33 | /** |
||
34 | * AssertReport constructor |
||
35 | * |
||
36 | * @param string $type |
||
37 | * @param \Gabrieljmj\Should\Assert\AssertInterface $assert |
||
38 | */ |
||
39 | public function __construct($type, AssertInterface $assert) |
||
44 | |||
45 | /** |
||
46 | * Assert type (class, property, method etc) |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | public function getType() |
||
54 | |||
55 | /** |
||
56 | * Returns null if status is true |
||
57 | * |
||
58 | * @return string|null |
||
59 | */ |
||
60 | public function getFailMessage() |
||
64 | |||
65 | /** |
||
66 | * Returns assert name |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getName() |
||
75 | |||
76 | /** |
||
77 | * Returns the tested element |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getTestedElement() |
||
85 | |||
86 | /** |
||
87 | * Returns the validation status |
||
88 | * |
||
89 | * @return boolean |
||
90 | */ |
||
91 | public function getStatus() |
||
95 | |||
96 | /** |
||
97 | * Returns the assert description |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | public function getDescription() |
||
105 | |||
106 | /** |
||
107 | * Returns the custom message in case of failure |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | public function getMessage() |
||
115 | } |