Closed chiefmyron closed 5 months ago
Original response:
This looks like something specific to the 10.x release of Laravel, which is why I missed it. Essentially, the Illuminate\Foundation\Testing\TestCase class is extending the runTest() method of the base PHPUnit TestCase class, and so the failure is bubbled up through that class. This method is not extended in the v11.x branch, or v9.x and earlier branches - it is specific only to v10.x.
Will have to check the full set of items in the stack to associate the last message reported against the test class file, rather than relying on it always being the last item in the stack.
Fix is to check the full set of files in the error stack, and pick the line number from the last reported instance of the test class file. If the test class file does not appear at all in the error stack, default to showing the peek against the method definition.
Awesome — thanks!!
I’m seeing [error peeks] show up on the wrong line though, I think because it’s using the last line of the stacktrace rather than the last line of code in my actual app:
Originally posted by @macbookandrew in https://github.com/chiefmyron/phpunit-test-workbench/issues/98#issuecomment-2096211328