You are here

public function BatchApiTest::testListBatches in TMGMT Translator Smartling 8.4

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

@covers \Smartling\Batch\BatchApi::listBatches

File

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

Class

BatchApiTest
Test class for Smartling\Batch\BatchApi.

Namespace

Smartling\Tests\Unit

Code

public function testListBatches() {
  $endpointUrl = vsprintf('%s/%s/batches', [
    BatchApi::ENDPOINT_URL,
    $this->projectId,
  ]);
  $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
    ->listBatches();
}