You are here

public function ProgressTrackerApiFunctionalTest::testCreateRecord in TMGMT Translator Smartling 8.3

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

Tests for create record.

File

vendor/smartling/api-sdk-php/tests/functional/ProgressTrackerApiFunctionalTest.php, line 46

Class

ProgressTrackerApiFunctionalTest
Test class for Progress Tracker API examples.

Namespace

Smartling\Tests\Functional

Code

public function testCreateRecord() {
  try {
    $params = new RecordParameters();
    $params
      ->setTtl(15);
    $params
      ->setData([
      "foo" => "bar",
    ]);
    $result = $this->progressTrackerApi
      ->createRecord("space", "object", $params);
    $this
      ->assertArrayHasKey('recordUid', $result);
  } catch (SmartlingApiException $e) {
    $result = false;
  }
  return $result;
}