@MohamedTammam the issue is that the model event is not deleting the record. But you are right, that assertion method is better than the way I am doing it
public function setUp() {
parent::setUp();
// add this to remove all event listeners
Activity::flushEventListeners();
// reboot the static to reattach listeners
Activity::boot();
}
@MohamedTammam sorry for taking so long to get back to you. I have reviewed the discussion on GitHub and tried the solution you posted but it is not working
This is what I have right now on my setUp method
protected function setUp(): void
{
parent::setUp();
// add this to remove all event listeners
Activity::flushEventListeners();
// reboot the static to reattach listeners
Activity::boot();
$this->activity = Activity::factory()->create();
}