public function BaseApiAbstractTest::testClientIdAndClientVersionAndUserAgentExtensionsSpecified in TMGMT Translator Smartling 8.4
Same name and namespace in other branches
- 8.3 vendor/smartling/api-sdk-php/tests/unit/BaseApiAbstractTest.php \Smartling\Tests\Unit\BaseApiAbstractTest::testClientIdAndClientVersionAndUserAgentExtensionsSpecified()
Test custom client id, version and extension in user agent.
File
- vendor/
smartling/ api-sdk-php/ tests/ unit/ BaseApiAbstractTest.php, line 58
Class
Namespace
Smartling\Tests\UnitCode
public function testClientIdAndClientVersionAndUserAgentExtensionsSpecified() {
BaseApiAbstract::setCurrentClientId('php-connector');
BaseApiAbstract::setCurrentClientVersion('1.2.3');
BaseApiAbstract::setCurrentClientUserAgentExtension('dependency-1/version-1 dependency-2/version-2');
$instance = FileApi::create($this->authProvider, 'test');
$http_client = $this
->invokeMethod($instance, 'getHttpClient');
$this
->assertTrue(strpos($http_client
->getConfig()['headers']['User-Agent'], 'php-connector/1.2.3 dependency-1/version-1 dependency-2/version-2 GuzzleHttp/6') !== FALSE);
}