diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-08-22 16:56:00 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-08-22 16:56:00 +0200 |
commit | 5cd3f4e4dc679bac7e6cbbb27485da4d23c51e0b (patch) | |
tree | 1023d4ae3bb13c407a1702355515587b5eaf30a9 /tests/lib/LoggerTest.php | |
parent | b13092065a8d189965c50603910b052032156893 (diff) | |
download | nextcloud-server-5cd3f4e4dc679bac7e6cbbb27485da4d23c51e0b.tar.gz nextcloud-server-5cd3f4e4dc679bac7e6cbbb27485da4d23c51e0b.zip |
add test
Diffstat (limited to 'tests/lib/LoggerTest.php')
-rw-r--r-- | tests/lib/LoggerTest.php | 16 |
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); + } + } + } |