You are here

protected function ApiTestAbstract::prepareClientResponseMock in TMGMT Translator Smartling 8.2

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

File

vendor/smartling/api-sdk-php/tests/unit/ApiTestAbstract.php, line 213

Class

ApiTestAbstract
Class ApiTestAbstract @package Smartling\Tests

Namespace

Smartling\Tests\Unit

Code

protected function prepareClientResponseMock($setDefaultResponse = true) {
  $this->responseMock = $this
    ->getMockBuilder('GuzzleHttp\\Psr7\\Response')
    ->setMethods(array_merge(self::$responseInterfaceMethods, self::$messageInterfaceMethods))
    ->disableOriginalConstructor()
    ->getMock();
  if (true === $setDefaultResponse) {
    $this->responseMock
      ->expects($this
      ->any())
      ->method('getBody')
      ->willReturn($this->validResponse);
  }
  $this->responseMock
    ->expects($this
    ->any())
    ->method('getStatusCode')
    ->willReturn(200);
}