class ProjectApiFunctionalTest in TMGMT Translator Smartling 8.4
Same name and namespace in other branches
- 8.2 api-sdk-php/tests/functional/ProjectApiFunctionalTest.php \Smartling\Tests\Functional\ProjectApiFunctionalTest
- 8.2 vendor/smartling/api-sdk-php/tests/functional/ProjectApiFunctionalTest.php \Smartling\Tests\Functional\ProjectApiFunctionalTest
- 8.3 vendor/smartling/api-sdk-php/tests/functional/ProjectApiFunctionalTest.php \Smartling\Tests\Functional\ProjectApiFunctionalTest
Test class for Project API examples.
Hierarchy
- class \Smartling\Tests\Functional\ProjectApiFunctionalTest extends \PHPUnit_Framework_TestCase
Expanded class hierarchy of ProjectApiFunctionalTest
File
- vendor/
smartling/ api-sdk-php/ tests/ functional/ ProjectApiFunctionalTest.php, line 13
Namespace
Smartling\Tests\FunctionalView source
class ProjectApiFunctionalTest extends PHPUnit_Framework_TestCase {
/**
* @var ProjectApi
*/
private $projectApi;
/**
* Test mixture.
*/
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);
}
/**
* Test for project details.
*/
public function testProjectDetails() {
try {
$result = $this->projectApi
->getProjectDetails();
$this
->assertArrayHasKey('projectId', $result);
$this
->assertArrayHasKey('projectName', $result);
$this
->assertArrayHasKey('accountUid', $result);
$this
->assertArrayHasKey('archived', $result);
$this
->assertArrayHasKey('projectTypeCode', $result);
$this
->assertArrayHasKey('projectTypeDisplayValue', $result);
$this
->assertArrayHasKey('targetLocales', $result);
$this
->assertArrayHasKey('sourceLocaleId', $result);
$this
->assertArrayHasKey('sourceLocaleDescription', $result);
} catch (SmartlingApiException $e) {
$this
->fail($e
->getMessage());
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ProjectApiFunctionalTest:: |
private | property | ||
ProjectApiFunctionalTest:: |
public | function | Test mixture. | |
ProjectApiFunctionalTest:: |
public | function | Test for project details. |