diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-12-04 13:13:39 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2015-12-09 16:34:23 +0300 |
commit | 0c1c0295717f0e75aa725d1c6699a68151f2c758 (patch) | |
tree | d2b6c6ad19624fda1f1033706a717da011a11d7e /tests | |
parent | f9081303b1a2b1a255ec4e869b18d118977f324f (diff) |
hardening, add some checks for whitespace-only strings
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/comments/comment.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/lib/comments/comment.php b/tests/lib/comments/comment.php index f00dfd527f1..c6a8f118dd1 100644 --- a/tests/lib/comments/comment.php +++ b/tests/lib/comments/comment.php @@ -60,24 +60,24 @@ class Test_Comments_Comment extends TestCase public function simpleSetterProvider() { return [ - ['Id'], - ['ParentId'], - ['Message'], - ['Verb'], - ['ChildrenCount'], + ['Id', true], + ['ParentId', true], + ['Message', true], + ['Verb', true], + ['Verb', ''], + ['ChildrenCount', true], ]; } /** * @dataProvider simpleSetterProvider */ - public function testSimpleSetterInvalidInput($field) { + public function testSimpleSetterInvalidInput($field, $input) { $comment = new \OC\Comments\Comment(); $setter = 'set' . $field; $this->setExpectedException('InvalidArgumentException'); - // we have no field that is supposed to accept a Bool - $comment->$setter(true); + $comment->$setter($input); } public function roleSetterProvider() { @@ -85,9 +85,11 @@ class Test_Comments_Comment extends TestCase ['Actor', true, true], ['Actor', 'user', true], ['Actor', true, 'alice'], + ['Actor', ' ', ' '], ['Object', true, true], ['Object', 'file', true], ['Object', true, 'file64'], + ['Object', ' ', ' '], ]; } |