@@ -56,8 +56,11 @@ public function testCreationWithErrorContainingClosure() : void
5656 self ::assertSame ('name ' , $ tag ->getName ());
5757 self ::assertSame ('@name Body ' , $ tag ->render ());
5858 self ::assertSame ($ parentException , $ tag ->getException ());
59- self ::assertStringStartsWith ('(Closure at ' , $ tag ->getException ()->getPrevious ()->getTrace ()[0 ]['args ' ][0 ]);
60- self ::assertStringContainsString (__FILE__ , $ tag ->getException ()->getPrevious ()->getTrace ()[0 ]['args ' ][0 ]);
59+ $ trace = $ tag ->getException ()->getPrevious ()->getTrace ();
60+ if (isset ($ trace [0 ]['args ' ])) { // Not set by default on 7.4
61+ self ::assertStringStartsWith ('(Closure at ' , $ trace [0 ]['args ' ][0 ]);
62+ self ::assertStringContainsString (__FILE__ , $ trace [0 ]['args ' ][0 ]);
63+ }
6164 self ::assertEquals ($ parentException , unserialize (serialize ($ parentException )));
6265 }
6366 }
@@ -81,10 +84,13 @@ public function testCreationWithErrorContainingResource() : void
8184 self ::assertSame ('name ' , $ tag ->getName ());
8285 self ::assertSame ('@name Body ' , $ tag ->render ());
8386 self ::assertSame ($ parentException , $ tag ->getException ());
84- self ::assertStringStartsWith (
85- 'resource(stream) ' ,
86- $ tag ->getException ()->getPrevious ()->getTrace ()[0 ]['args ' ][0 ]
87- );
87+ $ trace = $ tag ->getException ()->getPrevious ()->getTrace ();
88+ if (isset ($ trace [0 ]['args ' ])) { // Not set by default on 7.4
89+ self ::assertStringStartsWith (
90+ 'resource(stream) ' ,
91+ $ trace [0 ]['args ' ][0 ]
92+ );
93+ }
8894 self ::assertEquals ($ parentException , unserialize (serialize ($ parentException )));
8995 }
9096 }
0 commit comments