Open brendt opened 5 years ago
The Mail facade already has a bunch of stuff to make this possible. Looks like it might just take someone to go through and standardise it across all the Facades.
https://github.com/laravel/framework/blob/5.8/src/Illuminate/Support/Facades/Mail.php
Would @mixin
be preferred? This allows the Fakes to change their method signatures without having to update the Facade's docblocks.
I would think so. But I also wonder if, because the methods aren't available until your call the Event::fake()
, if it would be better to ensure they all return the fake class and do...
$eventFake = Event::fake();
$eventFake->assertWhatever(...);
But that doesn't feel as nice as being able to continue to use the Facade.
It would be possible to add IDE support for test fake methods by adding a mixin docblock to the original facades like this:
This would allow autocompletion on fake methods. Would you be open for a PR that adds this on fakeable facades?