Skip to content

Commit a9ef146

Browse files
committed
Test coverage for exception handler.
Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
1 parent d608c8a commit a9ef146

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Exception/ResourceException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct($message = null, $errors = null, Exception $previous
4545
**/
4646
public function errors()
4747
{
48-
return $this->errors;
48+
return $this->getErrors();
4949
}
5050

5151
/**
@@ -68,4 +68,4 @@ public function hasErrors()
6868
return ! $this->errors->isEmpty();
6969
}
7070

71-
}
71+
}

tests/ExceptionHandlerTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,10 @@ public function testExceptionHandlerHandlesExceptionAndCreatesNewResponse()
5858
}
5959

6060

61+
public function testExceptionHandlerReturnsNullWhenNoMatchingHandler()
62+
{
63+
$this->assertNull($this->exceptionHandler->handle(new StubHttpException(404, 'bar')));
64+
}
65+
66+
6167
}

0 commit comments

Comments
 (0)