From 261debfee8382be6570f9bbb6f3fea936eadb676 Mon Sep 17 00:00:00 2001 From: Oliver Kaufmann Date: Wed, 16 Feb 2022 23:36:43 +0100 Subject: [PATCH] try fix tests --- tests/Feature/TeamworkTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/Feature/TeamworkTest.php b/tests/Feature/TeamworkTest.php index e2d7b79..b6bcb44 100644 --- a/tests/Feature/TeamworkTest.php +++ b/tests/Feature/TeamworkTest.php @@ -4,6 +4,7 @@ use Exception; use Illuminate\Support\Facades\Config; +use Illuminate\Support\Facades\Event; use Mockery as m; use Mpociot\Teamwork\TeamInvite; use Mpociot\Teamwork\TeamworkTeam; @@ -261,7 +262,7 @@ public function testCanInviteToTeamWithoutCallback() public function testInviteToTeamFiresEvent() { - $this->expectsEvents(\Mpociot\Teamwork\Events\UserInvitedToTeam::class); + Event::fake(); auth()->login($this->user); @@ -271,5 +272,7 @@ public function testInviteToTeamFiresEvent() \Teamwork::inviteToTeam($email, $team, function ($invite) { }); + + Event::assertDispatched(\Mpociot\Teamwork\Events\UserInvitedToTeam::class); } }