Пример #1
0
 public function testWatchOnMobileVideosV2()
 {
     $this->gdata->setMajorProtocolVersion(2);
     $feed = $this->gdata->getWatchOnMobileVideoFeed();
     $client = $this->gdata->getHttpClient();
     $positionOfAPIProjection = strpos($client->getLastRawRequest(), "/feeds/api/");
     $this->assertTrue(is_numeric($positionOfAPIProjection));
 }
Пример #2
0
 public function testSetClientIDAndDeveloperKeyHeader()
 {
     $applicationId = 'MyTestCompany-MyTestApp-0.1';
     $clientId = 'MyClientId';
     $developerKey = 'MyDeveloperKey';
     $httpClient = new \Zend\Http\Client();
     $yt = new YouTube($httpClient, $applicationId, $clientId, $developerKey);
     $this->assertTrue($yt instanceof YouTube);
     $client = $yt->getHttpClient();
     $this->assertEquals($client->getHeader('User-Agent'), \ZendGData\App::getUserAgentString($applicationId));
     $this->assertEquals($client->getHeader('X-GData-Key'), 'key=' . $developerKey);
     $this->assertEquals($client->getHeader('X-GData-Client'), $clientId);
 }