-
-
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
Regression in PHPUnit 7.5.10 with regard to Exception stubbing/mocking #3683
Comments
Thank you for your report. Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting. Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue. |
I have similar problem with exception mock.
Output:
|
CC @morozov |
Having the same problem here. It seems to be related to the changes introduced with #3604 when trying to mock the final function getMessage from Exception class. |
I can reproduce this with <?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
class Test extends TestCase
{
public function testOne(): void
{
$this->createMock(\Throwable::class);
}
} |
Thank you all for the information. I should be able to provide a fix within a few days. |
Mocking the driver exception like this worked up to 7.5.9, the fix of the issue #3596 seems to break it:
With 7.5.10 its not working anymore:
The text was updated successfully, but these errors were encountered: