public function ExceptionTest::testConstructorArrayMessage in TMGMT Translator Smartling 8.4
Same name and namespace in other branches
- 8.2 api-sdk-php/tests/unit/ExceptionTest.php \Smartling\Tests\ExceptionTest::testConstructorArrayMessage()
- 8.2 vendor/smartling/api-sdk-php/tests/unit/ExceptionTest.php \Smartling\Tests\ExceptionTest::testConstructorArrayMessage()
- 8.3 vendor/smartling/api-sdk-php/tests/unit/ExceptionTest.php \Smartling\Tests\ExceptionTest::testConstructorArrayMessage()
Check exception's constructor with array of errors passed in.
File
- vendor/
smartling/ api-sdk-php/ tests/ unit/ ExceptionTest.php, line 27
Class
- ExceptionTest
- Test class for Smartling\Exceptions\SmartlingApiException.
Namespace
Smartling\TestsCode
public function testConstructorArrayMessage() {
$exceptionArray = [
'errors' => [
[
'key' => 'error_key',
'message' => 'Error message.',
'details' => [
'errorId' => 'error_id',
],
],
],
];
$e = new SmartlingApiException($exceptionArray);
$this
->assertTrue(is_string($e
->getMessage()));
$this
->assertNotEmpty($e
->getMessage());
$this
->assertSame(print_r($exceptionArray, TRUE), $e
->getMessage());
}