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

29 lines
687 B
PHP

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