From b4dc602381a367ce9ed1a1bbe28b7903976fdabe Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 18 Feb 2017 18:25:46 -0500 Subject: Send comments by email --- tests/units/Validator/CommentValidatorTest.php | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'tests/units/Validator/CommentValidatorTest.php') 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); -- cgit v1.2.3