|
@@ 84-91 (lines=8) @@
|
| 81 |
|
$this->assertSame($uid, $result[0]['uid']);
|
| 82 |
|
}
|
| 83 |
|
|
| 84 |
|
public function testGetSuspiciousActivityCountForUid() {
|
| 85 |
|
$this->configMock->expects($this->once())
|
| 86 |
|
->method('getBruteForceProtectionTimeThreshold')
|
| 87 |
|
->willReturn('300');
|
| 88 |
|
$this->dbService->addFailedLoginAttempt("test1", "192.168.1.1");
|
| 89 |
|
$this->dbService->addFailedLoginAttempt("test1", "192.168.1.1");
|
| 90 |
|
$this->assertEquals(2, $this->dbService->getSuspiciousActivityCountForUid('test1'));
|
| 91 |
|
}
|
| 92 |
|
|
| 93 |
|
public function testGetSuspiciousActivityCountForIp() {
|
| 94 |
|
$this->configMock->expects($this->once())
|
|
@@ 93-100 (lines=8) @@
|
| 90 |
|
$this->assertEquals(2, $this->dbService->getSuspiciousActivityCountForUid('test1'));
|
| 91 |
|
}
|
| 92 |
|
|
| 93 |
|
public function testGetSuspiciousActivityCountForIp() {
|
| 94 |
|
$this->configMock->expects($this->once())
|
| 95 |
|
->method('getBruteForceProtectionTimeThreshold')
|
| 96 |
|
->willReturn('300');
|
| 97 |
|
$this->dbService->addFailedLoginAttempt("test1", "192.168.1.1");
|
| 98 |
|
$this->dbService->addFailedLoginAttempt("test1", "192.168.1.1");
|
| 99 |
|
$this->assertEquals(2, $this->dbService->getSuspiciousActivityCountForIp('192.168.1.1'));
|
| 100 |
|
}
|
| 101 |
|
|
| 102 |
|
public function testGetSuspiciousActivityCountForUidIpCombination() {
|
| 103 |
|
$this->configMock->expects($this->once())
|