-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong backtrace line is reported #5574
Comments
Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting without using PHPUnit internals directly. Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue. |
Thank you for your reply. Here is minimal repro:
PHPUnit 9.6 output (correct):
PHPUnit 10.4 output (incorrect):
Notice PHPUnit 9.6 reports line 19 and 18, but PHPUnit 10.4 reports (wrongly) 18 and 18. |
Complete reproducing test case based on the one shown in #5574 (comment)<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
final class Issue5574Test extends TestCase
{
public function testOne(): void
{
$innerException = new \Error('Inner Exception');
$outerException = new \Exception('My exception', 0, $innerException);
throw $outerException;
}
}
|
I believe the root cause is in Given that I see at least two options. One is create a separate function which replicates the behavior in The other option I see is to add a parameter to Edit: |
Summary
Below is minimal repro test with two exceptions created on a separate line. For some reasons, the same line for both exceptions is reported, but the decisive is where the exception was created.
native php dump: https://3v4l.org/EIXk2 (notice line 3 and 4 is reported)
How to reproduce
Current behavior
Expected behavior
no diff
The text was updated successfully, but these errors were encountered: