Skip to content

Commit

Permalink
add tests for Request::handle_request_exception()
Browse files Browse the repository at this point in the history
  • Loading branch information
dshovchko committed Nov 27, 2017
1 parent 97f9f48 commit 1e173f2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/RequestSendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,21 @@ public function test_send_exception()

$ret = $r->send();
}

/**
* @expectedException UAPAY\Exception\Transfer
* @expectedExceptionMessage an error occured during a transfer
*/
public function test_handle_request_exception()
{
$api_path = 'localhost';
$stub = $this->getMockForAbstractClass(
'\UAPAY\Request',
array(array('api_uri'=>$api_path))
);

$e = new RequestException("Error Communicating with Server", new Request('POST', $api_path));

$this->invokeMethod($stub, 'handle_request_exception', array($e));
}
}

0 comments on commit 1e173f2

Please sign in to comment.