You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simply put, mocking a class extending \Exception I was wondering why getMessage returns an empty string despite being mocked. It happens to be a public final method of \Exception. While I haven't checked, I'd risk saying that this will happen for other classes with final methods being extended.
Expected behaviour:
Issue / display a warning saying this method cannot be mocked / stubbed.
Actual behaviour:
The method is not mocked, it works as it would normally (in this case returning an empty string).
The text was updated successfully, but these errors were encountered:
Simply put, mocking a class extending
\Exception
I was wondering whygetMessage
returns an empty string despite being mocked. It happens to be a public final method of\Exception
. While I haven't checked, I'd risk saying that this will happen for other classes with final methods being extended.Expected behaviour:
Issue / display a warning saying this method cannot be mocked / stubbed.
Actual behaviour:
The method is not mocked, it works as it would normally (in this case returning an empty string).
The text was updated successfully, but these errors were encountered: