You are here

public function JobsApiFunctionalTest::testJobsApiAddFileToJob in TMGMT Translator Smartling 8.4

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

Test for add file to job get.

File

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

Class

JobsApiFunctionalTest
Test class for Jobs API examples.

Namespace

Smartling\Tests\Functional

Code

public function testJobsApiAddFileToJob() {
  try {
    $this->fileApi
      ->uploadFile('tests/resources/test.xml', 'test.xml', 'xml');
    $params = new AddFileToJobParameters();
    $params
      ->setFileUri('test.xml');
    $this->jobsApi
      ->addFileToJobSync($this->jobId, $params);
    $this->fileApi
      ->deleteFile('test.xml');
  } catch (SmartlingApiException $e) {
    $this
      ->fail($e
      ->getMessage());
  }
}