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()
3737 $ this ->validateFixture ($ fixtureFile , $ parser , $ failures );
3838 }
3939
40+ $ previous = null ;
4041 /** @var \Throwable $failure */
4142 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 ;
4456 }
4557 }
4658
@@ -120,9 +132,10 @@ private function validateCode(
120132 string $ where ,
121133 string $ actualCode = null
122134 ) {
135+
123136 $ 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 );
126139
127140 $ code === true
128141 ? static ::assertNotNull ($ actualCode , "{$ message } {$ where }. " )
You can’t perform that action at this time.
0 commit comments