Exemplo n.º 1
0
 public function testGetResponse()
 {
     $response = m::mock(ResponseInterface::class);
     $response->shouldReceive('getErrorCode')->andReturn(100001);
     $exception = new ResponseException($response);
     static::assertSame($response, $exception->getResponse());
 }
 /**
  * @param string            $uid
  * @param string            $expected
  * @param string            $signature
  * @param ResponseInterface $response
  * @param Exception|null    $previous
  */
 public function __construct($uid, $expected, $signature, ResponseInterface $response, Exception $previous = null)
 {
     $message = sprintf("The supplied signature for uid: %s does not match.\n Expected '%s'\n Supplied '%s'", $uid, $expected, $signature);
     parent::__construct($response, $message, $previous);
 }
 /**
  * @param int               $timestamp
  * @param ResponseInterface $response
  * @param Exception|null    $previous
  */
 public function __construct($timestamp, ResponseInterface $response, Exception $previous = null)
 {
     $message = sprintf('The supplied timestamp: %d is more than %d seconds different to now: %d', $timestamp, Signature::TIMESTAMP_OFFSET, time());
     parent::__construct($response, $message, $previous);
 }