You are here

public function FileApiTest::testLastModifiedInvalidResponseNoDataFoundItemsNotArray in TMGMT Translator Smartling 8.3

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

@covers \Smartling\File\FileApi::lastModified @expectedException \Smartling\Exceptions\SmartlingApiException @expectedExceptionMessage No data found for file test.xml.

File

vendor/smartling/api-sdk-php/tests/unit/FileApiTest.php, line 318

Class

FileApiTest
Test class for Smartling\File\FileApi.

Namespace

Smartling\Tests\Unit

Code

public function testLastModifiedInvalidResponseNoDataFoundItemsNotArray() {
  $this
    ->prepareClientResponseMock(false);
  $this->client
    ->expects($this
    ->once())
    ->method('request')
    ->willReturn($this->responseMock);
  $response = '{"response":{"code":"SUCCESS","messages":[], "data":{"totalCount":1629,"items": "not_array"}}}';
  $this->responseMock
    ->expects(self::any())
    ->method('getBody')
    ->willReturn($response);
  $this->object
    ->lastModified('test.xml');
}