Closed ezzatron closed 6 years ago
If you have a method that returns instances of a final class, and you attempt to stub using ->with(), a final class exception seems to be thrown:
->with()
$handle = mock(ClassA::class); $handle->methodThatReturnsFinalClass->with('something')->returns($instanceOfFinalClass);
Needs more investigation.
As far as I can tell, this is a red herring. The exception actually gets thrown when the mock is called, and there is no matching rule, which makes total sense.
If you have a method that returns instances of a final class, and you attempt to stub using
->with()
, a final class exception seems to be thrown:Needs more investigation.