koel/tests/Integration/ArtistTest.php
2017-08-05 17:56:11 +01:00

29 lines
662 B
PHP

<?php
namespace Tests\Integration;
use App\Models\Artist;
use Lastfm;
use Tests\TestCase;
class ArtistTest extends TestCase
{
/** @test */
public function extra_info_can_be_retrieved_for_an_artist()
{
// Given there's an artist
/** @var Artist $artist */
$artist = factory(Artist::class)->create();
// When I get the extra info
Lastfm::shouldReceive('getArtistInfo')
->once()
->with($artist->name)
->andReturn(['foo' => 'bar']);
$info = $artist->getInfo();
// Then I receive the extra info
$this->assertEquals(['foo' => 'bar'], $info);
}
}