You are here

public function ProjectApiFunctionalTest::setUp in TMGMT Translator Smartling 8.2

Same name in this branch
  1. 8.2 api-sdk-php/tests/functional/ProjectApiFunctionalTest.php \Smartling\Tests\Functional\ProjectApiFunctionalTest::setUp()
  2. 8.2 vendor/smartling/api-sdk-php/tests/functional/ProjectApiFunctionalTest.php \Smartling\Tests\Functional\ProjectApiFunctionalTest::setUp()
Same name and namespace in other branches
  1. 8.4 vendor/smartling/api-sdk-php/tests/functional/ProjectApiFunctionalTest.php \Smartling\Tests\Functional\ProjectApiFunctionalTest::setUp()
  2. 8.3 vendor/smartling/api-sdk-php/tests/functional/ProjectApiFunctionalTest.php \Smartling\Tests\Functional\ProjectApiFunctionalTest::setUp()

Test mixture.

File

vendor/smartling/api-sdk-php/tests/functional/ProjectApiFunctionalTest.php, line 24

Class

ProjectApiFunctionalTest
Test class for Project API examples.

Namespace

Smartling\Tests\Functional

Code

public function setUp() {
  $projectId = getenv('project_id');
  $userIdentifier = getenv('user_id');
  $userSecretKey = getenv('user_key');
  if (empty($projectId) || empty($userIdentifier) || empty($userSecretKey)) {
    $this
      ->fail('Missing required parameters');
  }
  $authProvider = AuthTokenProvider::create($userIdentifier, $userSecretKey);
  $this->projectApi = ProjectApi::create($authProvider, $projectId);
}