You are here

public function AuditLogApiTest::testSearchAccountLevelLogRecord in TMGMT Translator Smartling 8.3

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

@covers \Smartling\AuditLog\AuditLogApi::searchAccountLevelLogRecord

File

vendor/smartling/api-sdk-php/tests/unit/AuditLogApiTest.php, line 201

Class

AuditLogApiTest

Namespace

Smartling\Tests\Unit

Code

public function testSearchAccountLevelLogRecord() {
  $accountUid = "account_uid";
  $endpointUrl = vsprintf('%s/accounts/%s/logs', [
    AuditLogApi::ENDPOINT_URL,
    $accountUid,
  ]);
  $createParams = (new SearchRecordParameters())
    ->setSearchQuery("foo:bar")
    ->setOffset(1)
    ->setLimit(100)
    ->setSort("baz", SearchRecordParameters::ORDER_ASC);
  $this->client
    ->expects($this
    ->any())
    ->method('request')
    ->with('get', $endpointUrl, [
    'headers' => [
      'Accept' => 'application/json',
      'Authorization' => vsprintf('%s %s', [
        $this->authProvider
          ->getTokenType(),
        $this->authProvider
          ->getAccessToken(),
      ]),
    ],
    'exceptions' => false,
    'query' => [
      'q' => 'foo:bar',
      'offset' => 1,
      'limit' => 100,
      'sort' => 'baz:' . SearchRecordParameters::ORDER_ASC,
    ],
  ])
    ->willReturn($this->responseMock);
  $this->object
    ->searchAccountLevelLogRecord($accountUid, $createParams);
}