public function FileApiTest::testFailedReadFile in TMGMT Translator Smartling 8.4
Same name and namespace in other branches
- 8.2 api-sdk-php/tests/unit/FileApiTest.php \Smartling\Tests\Unit\FileApiTest::testFailedReadFile()
- 8.2 vendor/smartling/api-sdk-php/tests/unit/FileApiTest.php \Smartling\Tests\Unit\FileApiTest::testFailedReadFile()
- 8.3 vendor/smartling/api-sdk-php/tests/unit/FileApiTest.php \Smartling\Tests\Unit\FileApiTest::testFailedReadFile()
@covers \Smartling\File\FileApi::readFile
@expectedException \Smartling\Exceptions\SmartlingApiException @expectedExceptionMessage File unexisted was not able to be read.
File
- vendor/
smartling/ api-sdk-php/ tests/ unit/ FileApiTest.php, line 1002
Class
- FileApiTest
- Test class for Smartling\File\FileApi.
Namespace
Smartling\Tests\UnitCode
public function testFailedReadFile() {
$this
->prepareClientResponseMock();
$invalidFilePath = 'unexisted';
/**
* @var \PHPUnit_Framework_MockObject_MockObject|\Smartling\File\FileApi
*/
$fileApi = $this
->getMockBuilder('Smartling\\File\\FileApi')
->setConstructorArgs([
$this->projectId,
$this->client,
])
->getMock();
$stream = $this
->invokeMethod($fileApi, 'readFile', [
$invalidFilePath,
]);
$this
->assertEquals('stream', get_resource_type($stream));
}