You are here

public function BatchApiTest::testGetBatchStatus in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 vendor/smartling/api-sdk-php/tests/unit/BatchApiTest.php \Smartling\Tests\Unit\BatchApiTest::testGetBatchStatus()

@covers \Smartling\Batch\BatchApi::getBatchStatus

File

vendor/smartling/api-sdk-php/tests/unit/BatchApiTest.php, line 195

Class

BatchApiTest
Test class for Smartling\Batch\BatchApi.

Namespace

Smartling\Tests\Unit

Code

public function testGetBatchStatus() {
  $batchId = 'test_batch_id';
  $endpointUrl = vsprintf('%s/%s/batches/%s', [
    BatchApi::ENDPOINT_URL,
    $this->projectId,
    $batchId,
  ]);
  $this->client
    ->expects(self::once())
    ->method('request')
    ->with('get', $endpointUrl, [
    'headers' => [
      'Accept' => 'application/json',
      'Authorization' => vsprintf('%s %s', [
        $this->authProvider
          ->getTokenType(),
        $this->authProvider
          ->getAccessToken(),
      ]),
    ],
    'exceptions' => FALSE,
    'query' => [],
  ])
    ->willReturn($this->responseMock);
  $this->object
    ->getBatchStatus($batchId);
}