Tests for exceptions

This commit is contained in:
Julius Haertl
2016-10-29 14:24:39 +02:00
parent a09de583dd
commit f37ae9d688

View File

@@ -23,10 +23,12 @@
namespace OCA\Deck\Db; namespace OCA\Deck\Db;
use OCA\Deck\CardArchivedException;
use OCA\Deck\Controller\PageController; use OCA\Deck\Controller\PageController;
use OCA\Deck\NoPermissionException; use OCA\Deck\NoPermissionException;
use OCA\Deck\NotFoundException;
class NoPermissionExceptionTest extends \PHPUnit_Framework_TestCase { class ExceptionsTest extends \PHPUnit_Framework_TestCase {
public function testNoPermissionException() { public function testNoPermissionException() {
$c = new \stdClass(); $c = new \stdClass();
@@ -34,4 +36,14 @@ class NoPermissionExceptionTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('stdClass#mymethod: not allowed', $e->getMessage()); $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());
}
} }