You are here

public function AuthApiTest::testAuthenticate in TMGMT Translator Smartling 8.2

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

Test auth method.

File

vendor/smartling/api-sdk-php/tests/unit/AuthApiTest.php, line 39

Class

AuthApiTest
Test class for Smartling\AuthApi\AuthTokenProvider.

Namespace

Smartling\Tests

Code

public function testAuthenticate() {
  $endpointUrl = vsprintf('%s/authenticate', [
    AuthTokenProvider::ENDPOINT_URL,
  ]);
  $this->client
    ->expects(self::once())
    ->method('request')
    ->with('post', $endpointUrl, [
    'headers' => [
      'Accept' => 'application/json',
    ],
    'exceptions' => false,
    'json' => [
      'userIdentifier' => 'SomeUserIdentifier',
      'userSecret' => 'SomeSecretKey',
    ],
  ])
    ->willReturn($this->responseMock);
  $this
    ->invokeMethod($this->object, 'authenticate');
}