public function testLoveTrack() { $this->withoutEvents(); $this->createSampleMediaSet(); $user = factory(User::class)->create(['preferences' => ['lastfm_session_key' => 'bar']]); $interaction = Interaction::create(['user_id' => $user->id, 'song_id' => Song::first()->id]); $lastfm = m::mock(Lastfm::class, ['enabled' => true]); $lastfm->shouldReceive('toggleLoveTrack')->with($interaction->song->title, $interaction->song->album->artist->name, 'bar', false); (new LoveTrackOnLastfm($lastfm))->handle(new SongLikeToggled($interaction, $user)); }