diff options
Diffstat (limited to 'tests/units/Model')
-rw-r--r-- | tests/units/Model/InviteModelTest.php | 27 |
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')); + } +} |