mirror of
https://github.com/koel/koel
synced 2024-12-20 17:43:36 +00:00
25 lines
702 B
PHP
25 lines
702 B
PHP
<?php
|
|
|
|
namespace Tests\Unit\Services\ApiClients;
|
|
|
|
use App\Services\ApiClients\LastfmClient;
|
|
use GuzzleHttp\Client as GuzzleHttpClient;
|
|
use GuzzleHttp\Handler\MockHandler;
|
|
use GuzzleHttp\HandlerStack;
|
|
use GuzzleHttp\Psr7\Response;
|
|
use Illuminate\Support\Facades\File;
|
|
use Tests\TestCase;
|
|
|
|
use function Tests\test_path;
|
|
|
|
class LastfmClientTest extends TestCase
|
|
{
|
|
public function testGetSessionKey(): void
|
|
{
|
|
$mock = new MockHandler([new Response(200, [], File::get(test_path('blobs/lastfm/session-key.json')))]);
|
|
|
|
$client = new LastfmClient(new GuzzleHttpClient(['handler' => HandlerStack::create($mock)]));
|
|
|
|
self::assertSame('foo', $client->getSessionKey('bar'));
|
|
}
|
|
}
|