1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-08 22:26:41 +02:00
This commit is contained in:
Jordi Boggiano
2024-06-28 10:48:40 +02:00
parent 3ba77d1d39
commit 07cd08e0e4
34 changed files with 106 additions and 91 deletions

View File

@@ -103,16 +103,25 @@ class RedisHandlerTest extends TestCase
{
$redis = new class extends \Predis\Client {
public array $testResults = [];
public function rpush(...$args) {
public function rpush(...$args)
{
$this->testResults[] = ['rpush', ...$args];
return $this;
}
public function ltrim(...$args) {
public function ltrim(...$args)
{
$this->testResults[] = ['ltrim', ...$args];
return $this;
}
public function transaction(...$args) {
public function transaction(...$args)
{
$this->testResults[] = ['transaction start'];
return ($args[0])($this);
}
};

View File

@@ -59,7 +59,8 @@ class RotatingFileHandlerTest extends TestCase
unset($this->lastError);
}
private function rrmdir($directory) {
private function rrmdir($directory)
{
if (! is_dir($directory)) {
throw new InvalidArgumentException("$directory must be a directory");
}

View File

@@ -69,6 +69,7 @@ class SymfonyMailerHandlerTest extends TestCase
// Callback dynamically changes subject based on number of logged records
$callback = function ($content, array $records) use ($expectedMessage) {
$subject = \count($records) > 0 ? 'Emergency' : 'Normal';
return $expectedMessage->subject($subject);
};
$handler = new SymfonyMailerHandler($this->mailer, $callback);