summaryrefslogtreecommitdiff
path: root/tests/units/Validator/CommentValidatorTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/Validator/CommentValidatorTest.php')
-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);