Example #1
0
 public function test9917()
 {
     try {
         $user_id = "ganchiku";
         $youtube = new Services_YouTube(self::DEV_ID, array('usesCache' => true));
         $youtube->setDriver('xmlrpc');
         $user = $youtube->getProfile($user_id);
         $this->assertEquals('Shin', $user->user_profile->first_name);
         $this->assertEquals('Ohno', $user->user_profile->last_name);
     } catch (Services_YouTube_Exception $e) {
         echo $e;
     }
 }
Example #2
0
 public function testListFeatured()
 {
     try {
         $youtube = new Services_YouTube(self::DEV_ID);
         $youtube->setUseCache(true);
         $data = $youtube->listFeatured();
         $videos = $data->xpath('//video');
         $this->assertEquals(25, count($videos));
         // Array Response
         $youtube->setResponseFormat('array');
         $data = $youtube->listFeatured();
         $this->assertEquals(25, count($data['video_list']['video']));
         // XML_RPC driver
         $youtube->setDriver('xmlrpc');
         $youtube->setUseCache(false);
         $youtube->setResponseFormat('object');
         $data = $youtube->listFeatured();
         $videos = $data->xpath('//video');
         $this->assertEquals(25, count($videos));
     } catch (Services_YouTube_Exception $e) {
         print $e;
     }
 }