mercredi 20 juillet 2016

Event is not firing

I'm trying to fire event in my integration test but it is not triggering. I set up QUEUE_DRIVER=sync in my phpunit xml. Why is event and listener is not working ? The workflow of my app is next:

Create some entity. Send it to remote server (i use even and listener); Give back some id and write it to db.

 public function testCanGetCbdOfPlan() {
    $plan = factory(Plan::class)->create();

    $plan->save();

    Event::fire(new PlanSaveEvent($plan)); // There  cbd_id should be added to the $plan

    $this->assertNotEmpty($plan->cbd_id, 'CBD_ID is empty');
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire