user = User::factory()->create(['preferences' => ['lastfm_session_key' => 'foo']]); $this->song = Song::factory()->make(); $this->job = new UpdateLastfmNowPlayingJob($this->user, $this->song); } public function testHandle(): void { $lastFm = Mockery::mock(LastfmService::class); $lastFm->shouldReceive('updateNowPlaying') ->once() ->with( $this->song->artist->name, $this->song->title, $this->song->album->name, $this->song->length, 'foo' ); $this->job->handle($lastFm); } }