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); } }