You are here

public function JobsApiTest::testGetJob 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::testGetJob()

@covers \Smartling\Jobs\JobsApi::getJob

File

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

Class

JobsApiTest
Test class for Smartling\Jobs\JobsApi.

Namespace

Smartling\Tests\Unit

Code

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