Confirms that the expected exception is thrown.
public function testRequestNotFound() {
$chain = new ChainMatcher();
$resource_not_found = new MockMatcher(function (Request $request) {
throw new ResourceNotFoundException();
});
try {
$chain
->add($resource_not_found);
$chain
->matchRequest(Request::create('my/path'));
} catch (ResourceNotFoundException $e) {
$this
->pass('Correct exception thrown.');
} catch (Exception $e) {
$this
->fail('Incorrect exception thrown: ' . get_class($e));
}
}