summaryrefslogtreecommitdiff
path: root/tests/units
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-01-22 22:38:00 -0500
committerFrederic Guillot <fred@kanboard.net>2017-01-22 22:38:00 -0500
commit10d96bfd668f445249190c52bedb2eb0e7e9410d (patch)
tree951bcf637b9371529a6552a2efd22e7a84707d9e /tests/units
parent2f43d365a0aaeff638eb4731bcff6907b491633a (diff)
Add user invitations
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/Model/InviteModelTest.php27
1 files changed, 27 insertions, 0 deletions
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'));
+ }
+}