koel/tests/Feature/YouTubeTest.php

25 lines
533 B
PHP
Raw Normal View History

2016-07-14 08:47:50 +00:00
<?php
2017-02-14 06:53:02 +00:00
namespace Tests\Feature;
2016-07-14 08:47:50 +00:00
use App\Models\Song;
use Illuminate\Foundation\Testing\WithoutMiddleware;
2017-08-05 18:55:02 +00:00
use YouTube;
2016-07-14 08:47:50 +00:00
2017-08-05 16:56:11 +00:00
class YouTubeTest extends TestCase
2016-07-14 08:47:50 +00:00
{
2017-08-05 16:56:11 +00:00
use WithoutMiddleware;
2016-07-14 08:47:50 +00:00
2017-08-05 18:55:02 +00:00
/** @test */
public function youtube_videos_related_to_a_song_can_be_searched()
2016-07-14 08:47:50 +00:00
{
$this->createSampleMediaSet();
$song = Song::first();
// We test on the facade here
2017-08-05 18:55:02 +00:00
YouTube::shouldReceive('searchVideosRelatedToSong')->once();
2016-07-14 08:47:50 +00:00
2017-02-14 06:53:02 +00:00
$this->getAsUser("/api/youtube/search/song/{$song->id}");
2016-07-14 08:47:50 +00:00
}
}