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