File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,22 @@ public function testAllFixtures()
37
37
$ this ->validateFixture ($ fixtureFile , $ parser , $ failures );
38
38
}
39
39
40
+ $ previous = null ;
40
41
/** @var \Throwable $failure */
41
42
foreach ($ failures as $ failure ) {
42
- $ exception = $ failure instanceof \Exception ? $ failure : null ;
43
- throw new AssertionFailedError ($ failure ->getMessage (), $ failure ->getCode (), $ exception );
43
+ if (!$ failure instanceof \Throwable) {
44
+ continue ;
45
+ }
46
+
47
+ $ previous = new AssertionFailedError (
48
+ $ failure ->getMessage (),
49
+ $ failure ->getCode (),
50
+ $ previous
51
+ );
52
+ }
53
+
54
+ if ($ previous ) {
55
+ throw $ previous ;
44
56
}
45
57
}
46
58
@@ -120,9 +132,10 @@ private function validateCode(
120
132
string $ where ,
121
133
string $ actualCode = null
122
134
) {
135
+
123
136
$ message = is_string ($ code )
124
- ? sprintf (" Expected %s code '%s' was not found " , $ type , $ code )
125
- : sprintf (" Expected %s code was not found " , $ type, $ code );
137
+ ? sprintf (' Expected %s code \ '%s \ ' was not found ' , $ type , $ code )
138
+ : sprintf (' Expected %s was not found ' , $ type );
126
139
127
140
$ code === true
128
141
? static ::assertNotNull ($ actualCode , "{$ message } {$ where }. " )
You can’t perform that action at this time.
0 commit comments