@@ -56,8 +56,11 @@ public function testCreationWithErrorContainingClosure() : void
56
56
self ::assertSame ('name ' , $ tag ->getName ());
57
57
self ::assertSame ('@name Body ' , $ tag ->render ());
58
58
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
+ }
61
64
self ::assertEquals ($ parentException , unserialize (serialize ($ parentException )));
62
65
}
63
66
}
@@ -81,10 +84,13 @@ public function testCreationWithErrorContainingResource() : void
81
84
self ::assertSame ('name ' , $ tag ->getName ());
82
85
self ::assertSame ('@name Body ' , $ tag ->render ());
83
86
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
+ }
88
94
self ::assertEquals ($ parentException , unserialize (serialize ($ parentException )));
89
95
}
90
96
}
0 commit comments