[ 'summary', 'full', ], ]; public function testGet(): void { config(['koel.lastfm.key' => 'foo']); config(['koel.lastfm.secret' => 'geheim']); /** @var Artist $artist */ $artist = Artist::factory()->create(); $lastfm = self::mock(MediaInformationService::class); $lastfm->shouldReceive('getArtistInformation') ->with(Mockery::on(static fn (Artist $a) => $a->is($artist))) ->andReturn(ArtistInformation::make( url: 'https://lastfm.com/artist/foo', image: 'https://lastfm.com/image/foo', bio: [ 'summary' => 'foo', 'full' => 'bar', ], )); $this->getAsUser('api/artists/' . $artist->id . '/information') ->assertJsonStructure(self::JSON_STRUCTURE); } public function testGetWithoutLastfmStillReturnsValidStructure(): void { config(['koel.lastfm.key' => null]); config(['koel.lastfm.secret' => null]); /** @var Artist $artist */ $artist = Artist::factory()->create(); $this->getAsUser('api/artists/' . $artist->id . '/information') ->assertJsonStructure(self::JSON_STRUCTURE); } }