koel/tests/Feature/YouTubeTest.php
2017-08-05 19:55:02 +01:00

24 lines
533 B
PHP

<?php
namespace Tests\Feature;
use App\Models\Song;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use YouTube;
class YouTubeTest extends TestCase
{
use WithoutMiddleware;
/** @test */
public function youtube_videos_related_to_a_song_can_be_searched()
{
$this->createSampleMediaSet();
$song = Song::first();
// We test on the facade here
YouTube::shouldReceive('searchVideosRelatedToSong')->once();
$this->getAsUser("/api/youtube/search/song/{$song->id}");
}
}