public function testGetSongFromSpotifyReturnsDefaultOnNotFound() { $song = new Song(); $song->setTitle('Foo song')->setArtist('Bar'); $this->trackFinder->method('findTrack')->willThrowException(NoTracksFoundException::emptyResult()); $result = $this->trackConverter->getSongFromSpotify($song); $this->assertEquals($song->getTitle(), $result->getName(), 'Name should be set to default'); $this->assertEquals($song->getArtist(), $result->getArtists()[0]->getName(), 'Artist should be set to default'); }