Tests
This commit is contained in:
@@ -27,6 +27,7 @@ use OCA\Deck\CardArchivedException;
|
||||
use OCA\Deck\Controller\PageController;
|
||||
use OCA\Deck\NoPermissionException;
|
||||
use OCA\Deck\NotFoundException;
|
||||
use OCA\Deck\StatusException;
|
||||
|
||||
class ExceptionsTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
@@ -34,11 +35,13 @@ class ExceptionsTest extends \PHPUnit_Framework_TestCase {
|
||||
$c = new \stdClass();
|
||||
$e = new NoPermissionException('not allowed', $c, 'mymethod');
|
||||
$this->assertEquals('stdClass#mymethod: not allowed', $e->getMessage());
|
||||
$this->assertEquals(403, $e->getStatus());
|
||||
}
|
||||
|
||||
public function testNotFoundException() {
|
||||
$e = new NotFoundException('foo');
|
||||
$this->assertEquals('foo', $e->getMessage());
|
||||
$this->assertEquals(404, $e->getStatus());
|
||||
}
|
||||
|
||||
public function testCardArchivedException() {
|
||||
@@ -46,4 +49,10 @@ class ExceptionsTest extends \PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals('foo', $e->getMessage());
|
||||
}
|
||||
|
||||
public function testStatusException() {
|
||||
$e = new StatusException('foo');
|
||||
$this->assertEquals('foo', $e->getMessage());
|
||||
$this->assertEquals(500, $e->getStatus());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user