You are here

public function JobsApiTest::testCheckAsynchronousProcessingStatus in TMGMT Translator Smartling 8.4

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

@covers \Smartling\Jobs\JobsApi::checkAsynchronousProcessingStatus

File

vendor/smartling/api-sdk-php/tests/unit/JobsApiTest.php, line 386

Class

JobsApiTest
Test class for Smartling\Jobs\JobsApi.

Namespace

Smartling\Tests\Unit

Code

public function testCheckAsynchronousProcessingStatus() {
  $jobId = 'Some job id';
  $processId = 'Some process id';
  $endpointUrl = vsprintf('%s/%s/jobs/%s/processes/%s', [
    JobsApi::ENDPOINT_URL,
    $this->projectId,
    $jobId,
    $processId,
  ]);
  $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
    ->checkAsynchronousProcessingStatus($jobId, $processId);
}