-
-
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
Cannot expect exception of type "ClassMirrorException" #4123
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. A test case that involves Prophecy is not minimal, sorry. |
Thank you @sebastianbergmann for the very quick answer. If something more is needed let me know. |
I have to repeat myself: a test case that involves Prophecy is not minimal, sorry. |
Got it. PR: #4124 And thanks again for the time. |
#4124 still uses Prophecy. Please reproduce the issue you want to report without Prophecy. |
Of course @sebastianbergmann . |
Summary
Cannot expect exception of type "ClassMirrorException" when mocking a final class with Prophecy
Current behavior
Given that a ClassMirrorException is thrown during test execution.
If the exception is expected test fails because the exception is never thrown.
How to reproduce
Prophetize a final class with prophecy and expect the exception:
class FinalClassMockingExampleTest extends TestCase
{
public function testNotAllowedFinalClassCannotBeMocked()
{
static::expectException(ClassMirrorException::class);
}
Expected behavior
The test does not fails.
The text was updated successfully, but these errors were encountered: