improved LDAP logging (#5517)
This commit is contained in:
30
tests/Mocks/TestLogger.php
Normal file
30
tests/Mocks/TestLogger.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Mocks;
|
||||
|
||||
use Psr\Log\AbstractLogger;
|
||||
|
||||
class TestLogger extends AbstractLogger
|
||||
{
|
||||
private array $logs = [];
|
||||
|
||||
public function log($level, string|\Stringable $message, array $context = []): void
|
||||
{
|
||||
$this->logs[] = [$level, $message, $context];
|
||||
}
|
||||
|
||||
public function cleanLogs(): array
|
||||
{
|
||||
$logs = $this->logs;
|
||||
$this->logs = [];
|
||||
|
||||
return $logs;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user