From 11a774e555786182dd634676811e3c58f316dad0 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 18 Feb 2017 20:21:48 -0500 Subject: Send tasks by email --- tests/units/Validator/TaskValidatorTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/units/Validator/TaskValidatorTest.php') 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); -- cgit v1.2.3