/** * GIVEN An <sdkApi> that will thrown an <exception> of <exceptionType> when making a request. * WHEN A request is made. * THEN The <exception> will be caught. * AND An exception of <expectedExceptionType> will be thrown. * * @param string * @param string * @dataProvider provideSdkExceptions */ public function testSdkExceptionHandling($exceptionType, $expectedExceptionType) { $exception = new $exceptionType(__METHOD__ . ': Test Exception'); $this->api->method('send')->will($this->throwException($exception)); $this->setExpectedException($expectedExceptionType); EcomDev_Utils_Reflection::invokeRestrictedMethod($this->allocator, 'makeRequest', [$this->api]); }