@@ -18,6 +18,21 @@ class Failure implements FailureInterface
18
18
*/
19
19
private $ reason ;
20
20
21
+ /**
22
+ * @var string|null
23
+ */
24
+ private $ expectedOutput ;
25
+
26
+ /**
27
+ * @var string|null
28
+ */
29
+ private $ actualOutput ;
30
+
31
+ /**
32
+ * @var string|null
33
+ */
34
+ private $ errors ;
35
+
21
36
/**
22
37
* @var string
23
38
*/
@@ -26,11 +41,16 @@ class Failure implements FailureInterface
26
41
/**
27
42
* @param string $name
28
43
* @param string|null $reason
44
+ * @param string|null $expectedOutput
45
+ * @param string|null $actualOutput
29
46
*/
30
- public function __construct ($ name , $ reason = null )
47
+ public function __construct ($ name , $ reason = null , $ expectedOutput = null , $ actualOutput = null , $ errors = null )
31
48
{
32
- $ this ->name = $ name ;
33
- $ this ->reason = $ reason ;
49
+ $ this ->name = $ name ;
50
+ $ this ->reason = $ reason ;
51
+ $ this ->expectedOutput = $ expectedOutput ;
52
+ $ this ->actualOutput = $ actualOutput ;
53
+ $ this ->errors = $ errors ;
34
54
}
35
55
36
56
/**
@@ -56,11 +76,14 @@ public static function fromCheckAndReason(CheckInterface $check, $reason)
56
76
/**
57
77
* @param string $name
58
78
* @param CodeExecutionException $e
79
+ * @param string|null $expectedOutput
80
+ * @param string|null $actualOutput
81
+ * @param string|null $errors
59
82
* @return static
60
83
*/
61
- public static function fromNameAndCodeExecutionFailure ($ name , CodeExecutionException $ e )
84
+ public static function fromNameAndCodeExecutionFailure ($ name , CodeExecutionException $ e, $ expectedOutput = null , $ actualOutput = null , $ errors = null )
62
85
{
63
- return new static ($ name , $ e ->getMessage ());
86
+ return new static ($ name , $ e ->getMessage (), $ expectedOutput , $ actualOutput , $ errors );
64
87
}
65
88
66
89
/**
@@ -92,4 +115,27 @@ public function getReason()
92
115
{
93
116
return $ this ->reason ;
94
117
}
118
+
119
+ /**
120
+ * @return string|null
121
+ */
122
+ public function getExpectedOutput ()
123
+ {
124
+ return $ this ->expectedOutput ;
125
+ }
126
+
127
+ /**
128
+ * @return string|null
129
+ */
130
+ public function getActualOutput ()
131
+ {
132
+ return $ this ->actualOutput ;
133
+ }
134
+
135
+ /**
136
+ * @return string|null
137
+ */
138
+ public function getErrors () {
139
+ return $ this ->errors ;
140
+ }
95
141
}
0 commit comments