18 $details = [
'key1' =>
'value1',
'key2' =>
'value2'];
19 $apiException = new \Magento\Framework\Webapi\Exception(
22 \
Magento\Framework\Webapi\Exception::HTTP_UNAUTHORIZED,
26 $apiException->getHttpCode(),
28 'Exception code is set incorrectly in construct.' 31 $apiException->getMessage(),
33 'Exception message is set incorrectly in construct.' 35 $this->assertEquals($apiException->getCode(),
$code,
'Exception code is set incorrectly in construct.');
36 $this->assertEquals($apiException->getDetails(),
$details,
'Details are set incorrectly in construct.');
46 $this->expectException(
'InvalidArgumentException');
47 $this->expectExceptionMessage(
"The specified HTTP code \"{$httpCode}\" is invalid.");
50 new \Magento\Framework\Webapi\Exception(
__(
'Message'), 0, $httpCode);
55 $apiException = new \Magento\Framework\Webapi\Exception(
58 \
Magento\Framework\Webapi\Exception::HTTP_UNAUTHORIZED
62 \
Magento\Webapi\Model\Soap\Fault::FAULT_CODE_SENDER,
63 $apiException->getOriginator(),
64 'Wrong Sender originator detecting.' 70 $apiException = new \Magento\Framework\Webapi\Exception(
73 \
Magento\Framework\Webapi\Exception::HTTP_INTERNAL_ERROR
77 \
Magento\Webapi\Model\Soap\Fault::FAULT_CODE_RECEIVER,
78 $apiException->getOriginator(),
79 'Wrong Receiver originator detecting.' 91 return [[300], [600]];
testConstructInvalidHttpCode($httpCode)
testGetOriginatorSender()
testGetOriginatorReceiver()
providerForTestConstructInvalidHttpCode()