You are here

public function AuditLogApiFunctionalTest::testCreateAccountLevelLogRecord in TMGMT Translator Smartling 8.3

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

File

vendor/smartling/api-sdk-php/tests/functional/AuditLogApiFunctionalTest.php, line 71

Class

AuditLogApiFunctionalTest

Namespace

Smartling\Tests\Functional

Code

public function testCreateAccountLevelLogRecord() {
  try {
    $user_id = uniqid();
    $params = (new CreateRecordParameters())
      ->setActionTime(time())
      ->setActionType(CreateRecordParameters::ACTION_TYPE_UPLOAD)
      ->setFileUri("file_uri")
      ->setFileUid("file_uid")
      ->setSourceLocaleId('en')
      ->setTargetLocaleIds([
      'de',
    ])
      ->setTranslationJobUid("smartling_job_uid")
      ->setTranslationJobName("smartling_job_name")
      ->setTranslationJobDueDate("smartling_job_due_date")
      ->setTranslationJobAuthorize(true)
      ->setBatchUid("batch_uid")
      ->setDescription("description")
      ->setClientUserId($user_id)
      ->setClientUserEmail("user_email")
      ->setClientUserName("user_name")
      ->setEnvId("env_id")
      ->setClientData("foo", "bar");
    $result = $this->auditLogApi
      ->createAccountLevelLogRecord(getenv("account_uid"), $params);
    $this
      ->assertArrayHasKey('_index', $result);
    $this
      ->assertArrayHasKey('_type', $result);
    $this
      ->assertArrayHasKey('_id', $result);
    $this
      ->assertArrayHasKey('_seq_no', $result);
  } catch (SmartlingApiException $e) {
    $result = false;
  }
  return $result;
}