diff --git a/test/src/Exception/IDPExceptionTest.php b/test/src/Exception/IDPExceptionTest.php index 3debc62..2dc6f8c 100644 --- a/test/src/Exception/IDPExceptionTest.php +++ b/test/src/Exception/IDPExceptionTest.php @@ -41,4 +41,32 @@ class IDPExceptionTest extends \PHPUnit_Framework_TestCase $this->assertEquals('message: 404: message', (string)$exception); } -} \ No newline at end of file + + public function testEmptyMessage() + { + $exception = new IDPException(array('error' => 'error_message', 'message' => '')); + // message should be the error text since message isn't specifically defined + $this->assertEquals('error_message', $exception->getMessage()); + } + + public function testNonEmptyMessage() + { + $exception = new IDPException(array('error' => 'error_message', 'message' => 'message')); + // message should be the error text since message isn't specifically defined + $this->assertEquals('message', $exception->getMessage()); + } + + public function testEmptyError() + { + $exception = new IDPException(array('error' => '', 'message' => 'message')); + // message should be the error text since message isn't specifically defined + $this->assertEquals('message', $exception->getMessage()); + } + + public function testEmptyAndMessage() + { + $exception = new IDPException(array('error' => '', 'message' => '')); + // message should be the error text since message isn't specifically defined + $this->assertEquals('Unknown Error.', $exception->getMessage()); + } +}