You are here

public function ContextApiFunctionalTest::testRenderContext in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.2 api-sdk-php/tests/functional/ContextApiFunctionalTest.php \Smartling\Tests\Functional\ContextApiFunctionalTest::testRenderContext()
  2. 8.2 vendor/smartling/api-sdk-php/tests/functional/ContextApiFunctionalTest.php \Smartling\Tests\Functional\ContextApiFunctionalTest::testRenderContext()
  3. 8.3 vendor/smartling/api-sdk-php/tests/functional/ContextApiFunctionalTest.php \Smartling\Tests\Functional\ContextApiFunctionalTest::testRenderContext()

Test for render context.

File

vendor/smartling/api-sdk-php/tests/functional/ContextApiFunctionalTest.php, line 139

Class

ContextApiFunctionalTest
Test class for Project API examples.

Namespace

Smartling\Tests\Functional

Code

public function testRenderContext() {
  try {
    $params = new UploadContextParameters();
    $params
      ->setContent('tests/resources/context.html');
    $params
      ->setName('test_context.html');
    $contextInfo = $this->contextApi
      ->uploadContext($params);
    $result = $this->contextApi
      ->renderContext($contextInfo['contextUid']);
    $this
      ->assertTrue($result);
  } catch (SmartlingApiException $e) {
    $this
      ->fail($e
      ->getMessage());
  }
}