summaryrefslogtreecommitdiff
path: root/tests/units/Model
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/Model')
-rw-r--r--tests/units/Model/CommentModelTest.php3
-rw-r--r--tests/units/Model/InviteModelTest.php27
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/units/Model/CommentModelTest.php b/tests/units/Model/CommentModelTest.php
index 4178a839..c75401cc 100644
--- a/tests/units/Model/CommentModelTest.php
+++ b/tests/units/Model/CommentModelTest.php
@@ -26,6 +26,7 @@ class CommentModelTest extends Base
$this->assertEquals(1, $comment['user_id']);
$this->assertEquals('admin', $comment['username']);
$this->assertEquals(time(), $comment['date_creation'], '', 3);
+ $this->assertEquals(time(), $comment['date_modification'], '', 3);
$comment = $commentModel->getById(2);
$this->assertNotEmpty($comment);
@@ -34,6 +35,7 @@ class CommentModelTest extends Base
$this->assertEquals(0, $comment['user_id']);
$this->assertEquals('', $comment['username']);
$this->assertEquals(time(), $comment['date_creation'], '', 3);
+ $this->assertEquals(time(), $comment['date_modification'], '', 3);
}
public function testGetAll()
@@ -73,6 +75,7 @@ class CommentModelTest extends Base
$comment = $commentModel->getById(1);
$this->assertNotEmpty($comment);
$this->assertEquals('bla', $comment['comment']);
+ $this->assertEquals(time(), $comment['date_modification'], '', 3);
}
public function testRemove()
diff --git a/tests/units/Model/InviteModelTest.php b/tests/units/Model/InviteModelTest.php
new file mode 100644
index 00000000..3a0519fb
--- /dev/null
+++ b/tests/units/Model/InviteModelTest.php
@@ -0,0 +1,27 @@
+<?php
+
+use Kanboard\Model\InviteModel;
+
+require_once __DIR__.'/../Base.php';
+
+class InviteModelTest extends Base
+{
+ public function testCreation()
+ {
+ $inviteModel = new InviteModel($this->container);
+
+ $this->container['emailClient']
+ ->expects($this->exactly(2))
+ ->method('send');
+
+ $inviteModel->createInvites(array('user@domain1.tld', '', 'user@domain2.tld'), 1);
+ }
+
+ public function testRemove()
+ {
+ $inviteModel = new InviteModel($this->container);
+ $inviteModel->createInvites(array('user@domain1.tld', 'user@domain2.tld'), 0);
+ $this->assertTrue($inviteModel->remove('user@domain1.tld'));
+ $this->assertFalse($inviteModel->remove('foobar'));
+ }
+}