aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2016-02-09 03:14:30 +0100
committerArthur Schiwon <blizzz@owncloud.com>2016-02-09 03:14:30 +0100
commit347ad3e223e2582124d56b0d7174886bde194c16 (patch)
tree8f8d508d1d78a6258eb14c46a457e9bc634631b4 /tests
parent850ac0cf84f2492b16204b811f58a0dc7dc43b6e (diff)
downloadnextcloud-server-347ad3e223e2582124d56b0d7174886bde194c16.tar.gz
nextcloud-server-347ad3e223e2582124d56b0d7174886bde194c16.zip
Limit comment message to 1k chars
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/comments/comment.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/lib/comments/comment.php b/tests/lib/comments/comment.php
index e6f9c941c96..9b3f2ab166e 100644
--- a/tests/lib/comments/comment.php
+++ b/tests/lib/comments/comment.php
@@ -2,6 +2,7 @@
namespace Test\Comments;
+use OCP\Comments\IComment;
use Test\TestCase;
class Test_Comments_Comment extends TestCase
@@ -107,6 +108,15 @@ class Test_Comments_Comment extends TestCase
$comment->$setter($type, $id);
}
+ /**
+ * @expectedException \OCP\Comments\MessageTooLongException
+ */
+ public function testSetUberlongMessage() {
+ $comment = new \OC\Comments\Comment();
+ $msg = str_pad('', IComment::MAX_MESSAGE_LENGTH + 1, 'x');
+ $comment->setMessage($msg);
+ }
+
}