summaryrefslogtreecommitdiff
path: root/tests/units/Validator
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-02-18 18:25:46 -0500
committerFrederic Guillot <fred@kanboard.net>2017-02-18 18:25:46 -0500
commitb4dc602381a367ce9ed1a1bbe28b7903976fdabe (patch)
tree7edc2532f56abd66ff7f20b8a75dd0268d69310c /tests/units/Validator
parent5710bab97198234afced474250f20e24332fd6fc (diff)
Send comments by email
Diffstat (limited to 'tests/units/Validator')
-rw-r--r--tests/units/Validator/CommentValidatorTest.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/units/Validator/CommentValidatorTest.php b/tests/units/Validator/CommentValidatorTest.php
index ce65e7a3..db6da446 100644
--- a/tests/units/Validator/CommentValidatorTest.php
+++ b/tests/units/Validator/CommentValidatorTest.php
@@ -6,6 +6,40 @@ use Kanboard\Validator\CommentValidator;
class CommentValidatorTest extends Base
{
+ public function testValidateMailCreation()
+ {
+ $commentValidator = new CommentValidator($this->container);
+
+ $result = $commentValidator->validateEmailCreation(array(
+ 'user_id' => 1,
+ 'task_id' => 1,
+ 'comment' => 'blah',
+ 'email' => 'test@localhost',
+ 'subject' => 'something',
+ ));
+
+ $this->assertTrue($result[0]);
+
+ $result = $commentValidator->validateEmailCreation(array(
+ 'user_id' => 1,
+ 'task_id' => 1,
+ 'comment' => 'blah',
+ 'email' => 'invalid',
+ 'subject' => 'something',
+ ));
+
+ $this->assertFalse($result[0]);
+
+ $result = $commentValidator->validateEmailCreation(array(
+ 'user_id' => 1,
+ 'task_id' => 1,
+ 'comment' => 'bla',
+ 'email' => 'test@localhost',
+ ));
+
+ $this->assertFalse($result[0]);
+ }
+
public function testValidateCreation()
{
$commentValidator = new CommentValidator($this->container);