Send comments by email

This commit is contained in:
Frederic Guillot
2017-02-18 18:25:46 -05:00
parent 5710bab971
commit b4dc602381
36 changed files with 230 additions and 70 deletions

View File

@@ -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);