summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-02-18 20:21:48 -0500
committerFrederic Guillot <fred@kanboard.net>2017-02-18 20:21:48 -0500
commit11a774e555786182dd634676811e3c58f316dad0 (patch)
tree4dd0092b45d15d1c6ae1db613e37eb9bb009c0ec /tests
parent93c05371a882b3c07d16457479129e42a2999492 (diff)
Send tasks by email
Diffstat (limited to 'tests')
-rw-r--r--tests/units/Validator/TaskValidatorTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/units/Validator/TaskValidatorTest.php b/tests/units/Validator/TaskValidatorTest.php
index e9d9ac09..0c7fead7 100644
--- a/tests/units/Validator/TaskValidatorTest.php
+++ b/tests/units/Validator/TaskValidatorTest.php
@@ -6,6 +6,23 @@ use Kanboard\Validator\TaskValidator;
class TaskValidatorTest extends Base
{
+ public function testValidationEmailCreation()
+ {
+ $taskValidator = new TaskValidator($this->container);
+
+ $result = $taskValidator->validateEmailCreation(array('email' => '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'));
+ $this->assertFalse($result[0]);
+ }
+
public function testRequiredFields()
{
$taskValidator = new TaskValidator($this->container);