You are here

public function JobsApiFunctionalTest::testJobsApiCheckAsynchronousProcessingStatus in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 vendor/smartling/api-sdk-php/tests/functional/JobsApiFunctionalTest.php \Smartling\Tests\Functional\JobsApiFunctionalTest::testJobsApiCheckAsynchronousProcessingStatus()

Test checks status of async process.

File

vendor/smartling/api-sdk-php/tests/functional/JobsApiFunctionalTest.php, line 277

Class

JobsApiFunctionalTest
Test class for Jobs API examples.

Namespace

Smartling\Tests\Functional

Code

public function testJobsApiCheckAsynchronousProcessingStatus() {
  try {
    $this->fileApi
      ->uploadFile('tests/resources/test.xml', 'test.xml', 'xml');
    $params = new AddLocaleToJobParameters();
    $params
      ->setSyncContent(false);
    $this->jobsApi
      ->addLocaleToJobSync($this->jobId, 'fr-FR', $params);
    $params = new AddFileToJobParameters();
    $params
      ->setTargetLocales([
      'fr-FR',
    ]);
    $params
      ->setFileUri('test.xml');
    $this->jobsApi
      ->addFileToJobSync($this->jobId, $params);
    $params = new AddLocaleToJobParameters();
    $params
      ->setSyncContent(true);
    $this->jobsApi
      ->addLocaleToJobSync($this->jobId, 'de-DE', $params);
    $this->fileApi
      ->deleteFile('test.xml');
  } catch (SmartlingApiException $e) {
    $this
      ->fail($e
      ->getMessage());
  }
}