/**
  * get activities by a user
  * @param username
  * @return Zend_Gdata_YouTube_ActivityFeed
  */
 public function getActivitiesByUser($user)
 {
     /* @var $ytq Zend_Gdata_YouTube_VideoQuery */
     //$ytq = $this->yt->newQuery(Zend_Gdata_YouTube::ACTIVITY_FEED_URI . '?author=' . $user);
     //$ytq->setStartIndex($page * self::ITEMS_PER_PAGE);
     //$ytq->setMaxResults(self::ITEMS_PER_PAGE);
     return $this->yt->getActivityForUser($user);
 }
Exemple #2
0
 public function testThrowExceptionOnActivityFeedRequestForMoreThan20Users()
 {
     $exceptionThrown = false;
     $listOfMoreThan20Users = null;
     $youtube = new Zend_Gdata_YouTube();
     $youtube->setMajorProtocolVersion(2);
     for ($x = 0; $x < 30; $x++) {
         $listOfMoreThan20Users .= "user{$x}";
         if ($x != 29) {
             $listOfMoreThan20Users .= ",";
         }
     }
     try {
         $youtube->getActivityForUser($listOfMoreThan20Users);
     } catch (Zend_Gdata_App_InvalidArgumentException $e) {
         $exceptionThrown = true;
     }
     $this->assertTrue($exceptionThrown, 'Was expecting an exception on ' . 'a request to ->getActivityForUser when more than 20 users were ' . 'specified in YouTube.php');
 }