You are here

private function ContextApiTest::prepareContextApiMock in TMGMT Translator Smartling 8.2

Same name in this branch
  1. 8.2 api-sdk-php/tests/unit/ContextApiTest.php \Smartling\Tests\ContextApiTest::prepareContextApiMock()
  2. 8.2 vendor/smartling/api-sdk-php/tests/unit/ContextApiTest.php \Smartling\Tests\ContextApiTest::prepareContextApiMock()
Same name and namespace in other branches
  1. 8.4 vendor/smartling/api-sdk-php/tests/unit/ContextApiTest.php \Smartling\Tests\ContextApiTest::prepareContextApiMock()
  2. 8.3 vendor/smartling/api-sdk-php/tests/unit/ContextApiTest.php \Smartling\Tests\ContextApiTest::prepareContextApiMock()
2 calls to ContextApiTest::prepareContextApiMock()
ContextApiTest::setUp in api-sdk-php/tests/unit/ContextApiTest.php
Sets up the fixture, for example, opens a network connection. This method is called before a test is executed.
ContextApiTest::setUp in vendor/smartling/api-sdk-php/tests/unit/ContextApiTest.php
Sets up the fixture, for example, opens a network connection. This method is called before a test is executed.

File

api-sdk-php/tests/unit/ContextApiTest.php, line 28

Class

ContextApiTest
Test class for Smartling\Context\ContextApi.

Namespace

Smartling\Tests

Code

private function prepareContextApiMock() {
  $this->object = $this
    ->getMockBuilder('Smartling\\Context\\ContextApi')
    ->setMethods([
    'readFile',
  ])
    ->setConstructorArgs([
    $this->projectId,
    $this->client,
    null,
    ContextApi::ENDPOINT_URL,
  ])
    ->getMock();
  $this->object
    ->expects(self::any())
    ->method('readFile')
    ->willReturn($this->streamPlaceholder);
  $this
    ->invokeMethod($this->object, 'setAuth', [
    $this->authProvider,
  ]);
}