Add unit tests for new classes

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-06-17 21:29:35 +02:00
parent 1972edc38d
commit 7ad8080f82
22 changed files with 776 additions and 45 deletions

View File

@@ -25,11 +25,12 @@ namespace OCA\Deck\Db;
use OCA\Deck\ArchivedItemException;
use OCA\Deck\Controller\PageController;
use OCA\Deck\InvalidAttachmentType;
use OCA\Deck\NoPermissionException;
use OCA\Deck\NotFoundException;
use OCA\Deck\StatusException;
class ExceptionsTest extends \PHPUnit_Framework_TestCase {
class ExceptionsTest extends \Test\TestCase {
public function testNoPermissionException() {
$c = new \stdClass();
@@ -49,6 +50,11 @@ class ExceptionsTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('foo', $e->getMessage());
}
public function testInvalidAttachmentType() {
$e = new InvalidAttachmentType('foo');
$this->assertEquals('No matching IAttachmentService implementation found for type foo', $e->getMessage());
}
public function testStatusException() {
$e = new StatusException('foo');
$this->assertEquals('foo', $e->getMessage());