Added code coverage ignore comments

This commit is contained in:
Alex Bilbie 2016-03-10 17:22:10 +00:00
parent 8f0cb0e78c
commit 3b4a8cf5f3
2 changed files with 4 additions and 0 deletions

View File

@ -38,11 +38,13 @@ class AuthenticationServerMiddleware
$response = $this->server->respondToRequest($request, $response); $response = $this->server->respondToRequest($request, $response);
} catch (OAuthServerException $exception) { } catch (OAuthServerException $exception) {
return $exception->generateHttpResponse($response); return $exception->generateHttpResponse($response);
// @codeCoverageIgnoreStart
} catch (\Exception $exception) { } catch (\Exception $exception) {
$body = new Stream('php://temp', 'r+'); $body = new Stream('php://temp', 'r+');
$body->write($exception->getMessage()); $body->write($exception->getMessage());
return $response->withStatus(500)->withBody($body); return $response->withStatus(500)->withBody($body);
// @codeCoverageIgnoreEnd
} }
if (in_array($response->getStatusCode(), [400, 401, 500])) { if (in_array($response->getStatusCode(), [400, 401, 500])) {

View File

@ -38,11 +38,13 @@ class ResourceServerMiddleware
$request = $this->server->validateRequest($request); $request = $this->server->validateRequest($request);
} catch (OAuthServerException $exception) { } catch (OAuthServerException $exception) {
return $exception->generateHttpResponse($response); return $exception->generateHttpResponse($response);
// @codeCoverageIgnoreStart
} catch (\Exception $exception) { } catch (\Exception $exception) {
$body = new Stream('php://temp', 'r+'); $body = new Stream('php://temp', 'r+');
$body->write($exception->getMessage()); $body->write($exception->getMessage());
return $response->withStatus(500)->withBody($body); return $response->withStatus(500)->withBody($body);
// @codeCoverageIgnoreEnd
} }
// Pass the request and response on to the next responder in the chain // Pass the request and response on to the next responder in the chain