Closed jcergolj closed 3 years ago
@jcergolj sorry for the delay on this. A few follow-up questions before merging.
getProviders
do?Event::fake
?@jasonmccreary no worries.
1.What does the getProviders do? From the Laravel docs: Get the registered service provider instances if any exist.
// vendor/laravel/framework/src/Illuminate/Foundation/Application.php
/**
* Get the registered service provider instances if any exist.
*
* @param \Illuminate\Support\ServiceProvider|string $provider
* @return array
*/
public function getProviders($provider)
{
$name = is_string($provider) ? $provider : get_class($provider);
return Arr::where($this->serviceProviders, function ($value) use ($name) {
return $value instanceof $name;
});
}
Here is an article how would I use this: https://www.linkedin.com/pulse/my-elegant-way-testing-laravel-events-listeners-janez-cergolj/
Closed due to inactivity and conflicts. Feel free to rebase and reopen.
Here is my proposal for adding Event has Listener Assertion. I copied the code from Event List Listener artisan command and I added assertion.
Usage: