Example #1
0
 /**
  * Test setException method with \Magento\Webapi\Exception.
  */
 public function testSetWebapiExceptionException()
 {
     /** Init \Magento\Webapi\Exception */
     $apiException = new \Magento\Webapi\Exception('Exception message.', 0, \Magento\Webapi\Exception::HTTP_UNAUTHORIZED);
     $this->_responseRest->setException($apiException);
     /** Assert that \Magento\Webapi\Exception was set and presented in the list. */
     $this->assertTrue($this->_responseRest->hasExceptionOfType('Magento\\Webapi\\Exception'), 'Magento\\Webapi\\Exception was not set.');
 }