Ejemplo n.º 1
0
    public function testGetInboxFeedForCurrentUserV2()
    {
        $developerKey = constant(
            'TESTS_ZEND_GDATA_YOUTUBE_DEVELOPER_KEY');
        $clientId = constant(
            'TESTS_ZEND_GDATA_YOUTUBE_CLIENT_ID');
        $client = GData\ClientLogin::getHttpClient(
            $this->user, $this->pass, 'youtube' , null, 'ZF_UnitTest', null, null,
            'https://www.google.com/youtube/accounts/ClientLogin');

        $youtube = new YouTube($client, 'ZF_UnitTest',
            $clientId, $developerKey);
        $youtube->setMajorProtocolVersion(2);

        $inboxFeed = $youtube->getInboxFeedForCurrentUser();
        $this->assertTrue($inboxFeed instanceof YouTube\InboxFeed);
        $this->assertTrue(count($inboxFeed->entries) > 0, 'Test account ' .
            $this->ytAccount . ' had no messages in their inbox.');

        // get the first entry
        $inboxFeed->rewind();
        $inboxEntry = $inboxFeed->current();
        $this->assertTrue(
            $inboxEntry instanceof YouTube\InboxEntry);
        $this->assertTrue($inboxEntry->getTitle()->text != '');
    }