Alaouy\Tests\YoutubeTest::testGetRelatedVideos PHP Method

testGetRelatedVideos() public method

    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]);
    }