Пример #1
0
 /**
  * @test
  * @@vcr show_activity
  */
 public function should_get_activity()
 {
     VCR::turnOn();
     //VCR::insertCassette('authenticate');
     VCR::insertCassette('show_activity');
     //Arrange
     $sauce_api = new Client();
     $sauce_api->authenticate($_ENV['USERNAME_KEY'], $_ENV['TOKEN_PASSWORD'], Client::AUTH_HTTP_PASSWORD);
     //Act
     $what = $sauce_api->api('current_user')->getUserActivity($_ENV['USERNAME_KEY']);
     //Assert
     $this->assertArrayHasKey('subaccounts', $what);
     // To stop recording requests, eject the cassette
     VCR::eject();
     // Turn off VCR to stop intercepting requests
     VCR::turnOff();
 }
Пример #2
0
 /**
  * @test
  * @vcr job_asset_download_video
  */
 public function jobDownLoadVideo()
 {
     $username = $_ENV['USERNAME_KEY'];
     VCR::turnOn();
     //VCR::insertCassette('authenticate');
     VCR::insertCassette('job_asset_download_video');
     //Arrange
     $sauce_api = new Client();
     $sauce_api->authenticate($username, $_ENV['TOKEN_PASSWORD'], Client::AUTH_HTTP_PASSWORD);
     //Act
     $jobId = '1cde7b77e8744ff5b6198489ceffce81';
     $response = $sauce_api->api('assets')->downloadVideo($username, $jobId);
     //Assert
     $this->assertNotEmpty($response);
     // To stop recording requests, eject the cassette
     VCR::eject();
     // Turn off VCR to stop intercepting requests
     VCR::turnOff();
 }