Alaouy\Tests\YoutubeTest::testGetPopularVideos PHP Method

testGetPopularVideos() public method

    public function testGetPopularVideos()
    {
        $maxResult = rand(10, 30);
        $regionCode = 'us';
        $response = $this->youtube->getPopularVideos($regionCode, $maxResult);
        $this->assertNotNull('response');
        $this->assertEquals($maxResult, count($response));
        $this->assertEquals('youtube#video', $response[0]->kind);
        $this->assertObjectHasAttribute('statistics', $response[0]);
        $this->assertObjectHasAttribute('status', $response[0]);
        $this->assertObjectHasAttribute('snippet', $response[0]);
        $this->assertObjectHasAttribute('contentDetails', $response[0]);
    }