From f37ae9d688de2704ab07392c6d14d228ad88fda9 Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Sat, 29 Oct 2016 14:24:39 +0200 Subject: [PATCH] Tests for exceptions --- ...missionExceptionTest.php => ExceptionsTest.php} | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) rename tests/unit/{NoPermissionExceptionTest.php => ExceptionsTest.php} (74%) diff --git a/tests/unit/NoPermissionExceptionTest.php b/tests/unit/ExceptionsTest.php similarity index 74% rename from tests/unit/NoPermissionExceptionTest.php rename to tests/unit/ExceptionsTest.php index 0c772583f..32ba33088 100644 --- a/tests/unit/NoPermissionExceptionTest.php +++ b/tests/unit/ExceptionsTest.php @@ -23,10 +23,12 @@ namespace OCA\Deck\Db; +use OCA\Deck\CardArchivedException; use OCA\Deck\Controller\PageController; use OCA\Deck\NoPermissionException; +use OCA\Deck\NotFoundException; -class NoPermissionExceptionTest extends \PHPUnit_Framework_TestCase { +class ExceptionsTest extends \PHPUnit_Framework_TestCase { public function testNoPermissionException() { $c = new \stdClass(); @@ -34,4 +36,14 @@ class NoPermissionExceptionTest extends \PHPUnit_Framework_TestCase { $this->assertEquals('stdClass#mymethod: not allowed', $e->getMessage()); } + public function testNotFoundException() { + $e = new NotFoundException('foo'); + $this->assertEquals('foo', $e->getMessage()); + } + + public function testCardArchivedException() { + $e = new CardArchivedException('foo'); + $this->assertEquals('foo', $e->getMessage()); + } + } \ No newline at end of file