summaryrefslogtreecommitdiff
path: root/tests/units
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-11-17 14:46:23 -0800
committerFrederic Guillot <fred@kanboard.net>2017-11-17 14:46:23 -0800
commit2a313eb971ab36e166308f7882897ef204234d0a (patch)
tree6bb7a72ee7bce1c0baef908af49ff1b817c939f2 /tests/units
parent3b786e05e0e51ca6f85ef9a3ca0d649f3e34c534 (diff)
Add the possibility to send tasks and comments to multiple recipients
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/Validator/CommentValidatorTest.php12
-rw-r--r--tests/units/Validator/TaskValidatorTest.php8
2 files changed, 3 insertions, 17 deletions
diff --git a/tests/units/Validator/CommentValidatorTest.php b/tests/units/Validator/CommentValidatorTest.php
index db6da446..6066639b 100644
--- a/tests/units/Validator/CommentValidatorTest.php
+++ b/tests/units/Validator/CommentValidatorTest.php
@@ -14,7 +14,7 @@ class CommentValidatorTest extends Base
'user_id' => 1,
'task_id' => 1,
'comment' => 'blah',
- 'email' => 'test@localhost',
+ 'emails' => 'test@localhost, another@localhost',
'subject' => 'something',
));
@@ -24,20 +24,10 @@ class CommentValidatorTest extends Base
'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()
diff --git a/tests/units/Validator/TaskValidatorTest.php b/tests/units/Validator/TaskValidatorTest.php
index 12c5a497..e5f89556 100644
--- a/tests/units/Validator/TaskValidatorTest.php
+++ b/tests/units/Validator/TaskValidatorTest.php
@@ -10,16 +10,13 @@ class TaskValidatorTest extends Base
{
$taskValidator = new TaskValidator($this->container);
- $result = $taskValidator->validateEmailCreation(array('email' => 'test@localhost', 'subject' => 'test'));
+ $result = $taskValidator->validateEmailCreation(array('emails' => 'test@localhost', 'subject' => 'test'));
$this->assertTrue($result[0]);
- $result = $taskValidator->validateEmailCreation(array('email' => 'test', 'subject' => 'test'));
- $this->assertFalse($result[0]);
-
$result = $taskValidator->validateEmailCreation(array('subject' => 'test'));
$this->assertFalse($result[0]);
- $result = $taskValidator->validateEmailCreation(array('email' => 'test@localhost'));
+ $result = $taskValidator->validateEmailCreation(array('emails' => 'test@localhost, test@localhost'));
$this->assertFalse($result[0]);
}
@@ -104,7 +101,6 @@ class TaskValidatorTest extends Base
$result = $taskValidator->validateCreation(array('project_id' => 1, 'title' => 'test', 'date_due' => '02/01/2017 1:15 pm'));
$this->assertFalse($result[0]);
-
// date_started
// ISO dates
$result = $taskValidator->validateCreation(array('project_id' => 1, 'title' => 'test', 'date_started' => '2017-02-01'));