diff options
Diffstat (limited to 'apps/dav/tests/unit/Comments/CommentsPluginTest.php')
-rw-r--r-- | apps/dav/tests/unit/Comments/CommentsPluginTest.php | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/apps/dav/tests/unit/Comments/CommentsPluginTest.php b/apps/dav/tests/unit/Comments/CommentsPluginTest.php index 537989d9404..6cf23d1d42e 100644 --- a/apps/dav/tests/unit/Comments/CommentsPluginTest.php +++ b/apps/dav/tests/unit/Comments/CommentsPluginTest.php @@ -54,7 +54,7 @@ class CommentsPluginTest extends \Test\TestCase { /** @var CommentsPluginImplementation */ private $plugin; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->tree = $this->getMockBuilder(Tree::class) ->disableOriginalConstructor() @@ -170,10 +170,10 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - /** - * @expectedException \Sabre\DAV\Exception\NotFound - */ + public function testCreateCommentInvalidObject() { + $this->expectException(\Sabre\DAV\Exception\NotFound::class); + $commentData = [ 'actorType' => 'users', 'verb' => 'comment', @@ -252,10 +252,10 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - /** - * @expectedException \Sabre\DAV\Exception\BadRequest - */ + public function testCreateCommentInvalidActor() { + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); + $commentData = [ 'actorType' => 'robots', 'verb' => 'comment', @@ -340,10 +340,10 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - /** - * @expectedException \Sabre\DAV\Exception\UnsupportedMediaType - */ + public function testCreateCommentUnsupportedMediaType() { + $this->expectException(\Sabre\DAV\Exception\UnsupportedMediaType::class); + $commentData = [ 'actorType' => 'users', 'verb' => 'comment', @@ -428,10 +428,10 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - /** - * @expectedException \Sabre\DAV\Exception\BadRequest - */ + public function testCreateCommentInvalidPayload() { + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); + $commentData = [ 'actorType' => 'users', 'verb' => '', @@ -522,11 +522,11 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - /** - * @expectedException \Sabre\DAV\Exception\BadRequest - * @expectedExceptionMessage Message exceeds allowed character limit of - */ + public function testCreateCommentMessageTooLong() { + $this->expectException(\Sabre\DAV\Exception\BadRequest::class); + $this->expectExceptionMessage('Message exceeds allowed character limit of'); + $commentData = [ 'actorType' => 'users', 'verb' => 'comment', @@ -616,10 +616,10 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - /** - * @expectedException \Sabre\DAV\Exception\ReportNotSupported - */ + public function testOnReportInvalidNode() { + $this->expectException(\Sabre\DAV\Exception\ReportNotSupported::class); + $path = 'totally/unrelated/13'; $this->tree->expects($this->any()) @@ -639,10 +639,10 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->onReport(CommentsPluginImplementation::REPORT_NAME, [], '/' . $path); } - /** - * @expectedException \Sabre\DAV\Exception\ReportNotSupported - */ + public function testOnReportInvalidReportName() { + $this->expectException(\Sabre\DAV\Exception\ReportNotSupported::class); + $path = 'comments/files/42'; $this->tree->expects($this->any()) |