getRelatedVideos() public method

public getRelatedVideos ( string $videoId, $maxResults = 5, $part = ['id', 'snippet'] ) : array
$videoId string
return array
Beispiel #1
0
 public function testGetRelatedVideos()
 {
     $limit = rand(3, 10);
     $vID = 'rie-hPVJ7Sw';
     $response = $this->youtube->getRelatedVideos($vID, $limit);
     $this->assertEquals($limit, count($response));
     $this->assertNotNull('response');
     $this->assertEquals('youtube#searchResult', $response[0]->kind);
     $this->assertEquals('youtube#video', $response[0]->id->kind);
     //add all these assertions here in case the api is changed,
     //we can detect it instantly
     $this->assertObjectHasAttribute('snippet', $response[0]);
 }