summaryrefslogtreecommitdiff
path: root/tests/units/UserTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/UserTest.php')
-rw-r--r--tests/units/UserTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/units/UserTest.php b/tests/units/UserTest.php
index fcdf3934..6c68dfd2 100644
--- a/tests/units/UserTest.php
+++ b/tests/units/UserTest.php
@@ -12,6 +12,31 @@ use Model\Project;
class UserTest extends Base
{
+ public function testFailedLogin()
+ {
+ $u = new User($this->container);
+
+ $this->assertEquals(0, $u->getFailedLogin('admin'));
+ $this->assertEquals(0, $u->getFailedLogin('not_found'));
+
+ $this->assertTrue($u->incrementFailedLogin('admin'));
+ $this->assertTrue($u->incrementFailedLogin('admin'));
+
+ $this->assertEquals(2, $u->getFailedLogin('admin'));
+ $this->assertTrue($u->resetFailedLogin('admin'));
+ $this->assertEquals(0, $u->getFailedLogin('admin'));
+ }
+
+ public function testLocking()
+ {
+ $u = new User($this->container);
+
+ $this->assertFalse($u->isLocked('admin'));
+ $this->assertFalse($u->isLocked('not_found'));
+ $this->assertTrue($u->lock('admin', 1));
+ $this->assertTrue($u->isLocked('admin'));
+ }
+
public function testGetByEmail()
{
$u = new User($this->container);