You are here

public function FileApiTest::testConstructor in TMGMT Translator Smartling 8.2

Same name in this branch
  1. 8.2 api-sdk-php/tests/unit/FileApiTest.php \Smartling\Tests\Unit\FileApiTest::testConstructor()
  2. 8.2 vendor/smartling/api-sdk-php/tests/unit/FileApiTest.php \Smartling\Tests\Unit\FileApiTest::testConstructor()
Same name and namespace in other branches
  1. 8.4 vendor/smartling/api-sdk-php/tests/unit/FileApiTest.php \Smartling\Tests\Unit\FileApiTest::testConstructor()
  2. 8.3 vendor/smartling/api-sdk-php/tests/unit/FileApiTest.php \Smartling\Tests\Unit\FileApiTest::testConstructor()

Tests constructor.

@covers \Smartling\File\FileApi::__construct

@dataProvider constructorDataProvider

Parameters

string $projectId: Project Id string.

\GuzzleHttp\ClientInterface $client: Mock of Guzzle http client instance.

string|null $expected_base_url: Base Url string that will be used as based url.

File

vendor/smartling/api-sdk-php/tests/unit/FileApiTest.php, line 63

Class

FileApiTest
Test class for Smartling\File\FileApi.

Namespace

Smartling\Tests\Unit

Code

public function testConstructor($projectId, $client, $expected_base_url) {
  $fileApi = new FileApi($projectId, $client, null, $expected_base_url);
  $this
    ->assertEquals(rtrim($expected_base_url, '/') . '/' . $projectId, $this
    ->invokeMethod($fileApi, 'getBaseUrl'));
  $this
    ->assertEquals($projectId, $this
    ->invokeMethod($fileApi, 'getProjectId'));
  $this
    ->assertEquals($client, $this
    ->invokeMethod($fileApi, 'getHttpClient'));
}