Testing listeners with Queue::fake()
问题 My Laravel 5.5 application has a Product model. The Product model has a dispatchesEvents property that looks like this: /** * The event map for the model. * * @var array */ protected $dispatchesEvents = [ 'created' => ProductCreated::class, 'updated' => ProductUpdated::class, 'deleted' => ProductDeleted::class ]; I also have a listener that is called CreateProductInMagento which is mapped to the ProductCreated event in the EventServiceProvider . This listener implements the ShouldQueue