summaryrefslogtreecommitdiffstats
path: root/tests/lib/LoggerTest.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2016-08-22 16:56:00 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2016-08-22 16:56:00 +0200
commit5cd3f4e4dc679bac7e6cbbb27485da4d23c51e0b (patch)
tree1023d4ae3bb13c407a1702355515587b5eaf30a9 /tests/lib/LoggerTest.php
parentb13092065a8d189965c50603910b052032156893 (diff)
downloadnextcloud-server-5cd3f4e4dc679bac7e6cbbb27485da4d23c51e0b.tar.gz
nextcloud-server-5cd3f4e4dc679bac7e6cbbb27485da4d23c51e0b.zip
add test
Diffstat (limited to 'tests/lib/LoggerTest.php')
-rw-r--r--tests/lib/LoggerTest.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/lib/LoggerTest.php b/tests/lib/LoggerTest.php
index 4b80c01f343..abb9deebd55 100644
--- a/tests/lib/LoggerTest.php
+++ b/tests/lib/LoggerTest.php
@@ -122,4 +122,20 @@ class LoggerTest extends TestCase {
$this->assertContains('validateUserPass(*** sensitive parameters replaced ***)', $logLine);
}
}
+
+ /**
+ * @dataProvider userAndPasswordData
+ */
+ public function testDetecttryLogin($user, $password) {
+ $e = new \Exception('test');
+ $this->logger->logException($e);
+ $logLines = $this->getLogs();
+
+ foreach($logLines as $logLine) {
+ $this->assertNotContains($user, $logLine);
+ $this->assertNotContains($password, $logLine);
+ $this->assertContains('tryLogin(*** sensitive parameters replaced ***)', $logLine);
+ }
+ }
+
}