From 7ca003e6aeb410f209896500e40bbec38fd56c13 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 16 Mar 2025 13:30:20 +0100 Subject: [PATCH] Rename TestCase to MonologTestCase (#1953) --- src/Monolog/Test/MonologTestCase.php | 71 +++++++++++++++++++ src/Monolog/Test/TestCase.php | 55 +------------- .../Attribute/AsMonologProcessorTest.php | 4 +- .../Attribute/WithMonologChannelTest.php | 4 +- .../Formatter/ChromePHPFormatterTest.php | 4 +- .../Formatter/ElasticaFormatterTest.php | 4 +- .../Formatter/ElasticsearchFormatterTest.php | 4 +- .../Formatter/FlowdockFormatterTest.php | 4 +- .../Formatter/FluentdFormatterTest.php | 4 +- .../Formatter/GelfMessageFormatterTest.php | 4 +- .../GoogleCloudLoggingFormatterTest.php | 4 +- tests/Monolog/Formatter/JsonFormatterTest.php | 4 +- tests/Monolog/Formatter/LineFormatterTest.php | 4 +- .../Monolog/Formatter/LogglyFormatterTest.php | 4 +- .../Formatter/LogmaticFormatterTest.php | 4 +- .../Formatter/LogstashFormatterTest.php | 4 +- .../Formatter/MongoDBFormatterTest.php | 3 +- .../Formatter/NormalizerFormatterTest.php | 3 +- .../Monolog/Formatter/ScalarFormatterTest.php | 3 +- .../Monolog/Formatter/SyslogFormatterTest.php | 3 +- .../Formatter/WildfireFormatterTest.php | 3 +- tests/Monolog/Handler/AbstractHandlerTest.php | 3 +- .../Handler/AbstractProcessingHandlerTest.php | 3 +- tests/Monolog/Handler/AmqpHandlerTest.php | 3 +- .../Handler/BrowserConsoleHandlerTest.php | 3 +- tests/Monolog/Handler/BufferHandlerTest.php | 3 +- .../Monolog/Handler/ChromePHPHandlerTest.php | 3 +- tests/Monolog/Handler/CouchDBHandlerTest.php | 3 +- .../Handler/DeduplicationHandlerTest.php | 3 +- .../Handler/DoctrineCouchDBHandlerTest.php | 3 +- tests/Monolog/Handler/DynamoDbHandlerTest.php | 3 +- tests/Monolog/Handler/ElasticaHandlerTest.php | 3 +- .../Handler/ElasticsearchHandlerTest.php | 3 +- tests/Monolog/Handler/ErrorLogHandlerTest.php | 3 +- .../Handler/FallbackGroupHandlerTest.php | 3 +- tests/Monolog/Handler/FilterHandlerTest.php | 3 +- .../Handler/FingersCrossedHandlerTest.php | 3 +- tests/Monolog/Handler/FirePHPHandlerTest.php | 3 +- .../Monolog/Handler/FleepHookHandlerTest.php | 3 +- tests/Monolog/Handler/FlowdockHandlerTest.php | 3 +- tests/Monolog/Handler/GelfHandlerTest.php | 3 +- tests/Monolog/Handler/GroupHandlerTest.php | 3 +- tests/Monolog/Handler/HandlerWrapperTest.php | 3 +- .../Monolog/Handler/InsightOpsHandlerTest.php | 3 +- .../Monolog/Handler/LogEntriesHandlerTest.php | 3 +- tests/Monolog/Handler/LogmaticHandlerTest.php | 3 +- tests/Monolog/Handler/MailHandlerTest.php | 3 +- tests/Monolog/Handler/MongoDBHandlerTest.php | 3 +- .../Handler/NativeMailerHandlerTest.php | 27 +++---- tests/Monolog/Handler/NewRelicHandlerTest.php | 3 +- tests/Monolog/Handler/NoopHandlerTest.php | 3 +- tests/Monolog/Handler/NullHandlerTest.php | 3 +- tests/Monolog/Handler/OverflowHandlerTest.php | 3 +- .../Monolog/Handler/PHPConsoleHandlerTest.php | 5 +- tests/Monolog/Handler/ProcessHandlerTest.php | 3 +- tests/Monolog/Handler/PsrHandlerTest.php | 3 +- tests/Monolog/Handler/PushoverHandlerTest.php | 3 +- tests/Monolog/Handler/RedisHandlerTest.php | 3 +- .../Handler/RedisPubSubHandlerTest.php | 3 +- tests/Monolog/Handler/RollbarHandlerTest.php | 3 +- .../Handler/RotatingFileHandlerTest.php | 9 ++- tests/Monolog/Handler/SamplingHandlerTest.php | 4 +- .../Monolog/Handler/Slack/SlackRecordTest.php | 13 ++-- tests/Monolog/Handler/SlackHandlerTest.php | 3 +- .../Handler/SlackWebhookHandlerTest.php | 3 +- tests/Monolog/Handler/SocketHandlerTest.php | 3 +- tests/Monolog/Handler/StreamHandlerTest.php | 3 +- .../Handler/SymfonyMailerHandlerTest.php | 3 +- .../Monolog/Handler/SyslogUdpHandlerTest.php | 3 +- .../Handler/TelegramBotHandlerTest.php | 3 +- tests/Monolog/Handler/TestHandlerTest.php | 3 +- tests/Monolog/Handler/UdpSocketTest.php | 3 +- .../Handler/WhatFailureGroupHandlerTest.php | 3 +- .../Handler/ZendMonitorHandlerTest.php | 4 +- tests/Monolog/LoggerTest.php | 4 +- .../Processor/ClosureContextProcessorTest.php | 3 +- tests/Monolog/Processor/GitProcessorTest.php | 3 +- .../Processor/HostnameProcessorTest.php | 4 +- .../Processor/IntrospectionProcessorTest.php | 3 +- .../Processor/LoadAverageProcessorTest.php | 4 +- .../MemoryPeakUsageProcessorTest.php | 4 +- .../Processor/MemoryUsageProcessorTest.php | 4 +- .../Processor/MercurialProcessorTest.php | 4 +- .../Processor/ProcessIdProcessorTest.php | 4 +- .../Processor/PsrLogMessageProcessorTest.php | 3 +- tests/Monolog/Processor/TagProcessorTest.php | 4 +- tests/Monolog/Processor/UidProcessorTest.php | 4 +- tests/Monolog/Processor/WebProcessorTest.php | 4 +- tests/Monolog/PsrLogCompatTest.php | 3 +- tests/Monolog/SignalHandlerTest.php | 4 +- 90 files changed, 197 insertions(+), 262 deletions(-) create mode 100644 src/Monolog/Test/MonologTestCase.php diff --git a/src/Monolog/Test/MonologTestCase.php b/src/Monolog/Test/MonologTestCase.php new file mode 100644 index 00000000..34c7724e --- /dev/null +++ b/src/Monolog/Test/MonologTestCase.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Test; + +use Monolog\Level; +use Monolog\Logger; +use Monolog\LogRecord; +use Monolog\JsonSerializableDateTimeImmutable; +use Monolog\Formatter\FormatterInterface; +use Psr\Log\LogLevel; + +/** + * Lets you easily generate log records and a dummy formatter for testing purposes + * + * @author Jordi Boggiano + */ +class MonologTestCase extends \PHPUnit\Framework\TestCase +{ + /** + * @param array $context + * @param array $extra + * + * @phpstan-param value-of|value-of|Level|LogLevel::* $level + */ + protected function getRecord(int|string|Level $level = Level::Warning, string|\Stringable $message = 'test', array $context = [], string $channel = 'test', \DateTimeImmutable $datetime = new JsonSerializableDateTimeImmutable(true), array $extra = []): LogRecord + { + return new LogRecord( + message: (string) $message, + context: $context, + level: Logger::toMonologLevel($level), + channel: $channel, + datetime: $datetime, + extra: $extra, + ); + } + + /** + * @phpstan-return list + */ + protected function getMultipleRecords(): array + { + return [ + $this->getRecord(Level::Debug, 'debug message 1'), + $this->getRecord(Level::Debug, 'debug message 2'), + $this->getRecord(Level::Info, 'information'), + $this->getRecord(Level::Warning, 'warning'), + $this->getRecord(Level::Error, 'error'), + ]; + } + + protected function getIdentityFormatter(): FormatterInterface + { + $formatter = $this->createMock(FormatterInterface::class); + $formatter->expects(self::any()) + ->method('format') + ->willReturnCallback(function ($record) { + return $record->message; + }); + + return $formatter; + } +} diff --git a/src/Monolog/Test/TestCase.php b/src/Monolog/Test/TestCase.php index ec5751b7..bf40b31f 100644 --- a/src/Monolog/Test/TestCase.php +++ b/src/Monolog/Test/TestCase.php @@ -11,64 +11,13 @@ namespace Monolog\Test; -use Monolog\Level; -use Monolog\Logger; -use Monolog\LogRecord; -use Monolog\JsonSerializableDateTimeImmutable; -use Monolog\Formatter\FormatterInterface; -use Psr\Log\LogLevel; -use ReflectionProperty; - /** * Lets you easily generate log records and a dummy formatter for testing purposes * * @author Jordi Boggiano * - * @internal feel free to reuse this to test your own handlers, this is marked internal to avoid issues with PHPStorm https://github.com/Seldaek/monolog/issues/1677 + * @deprecated use MonologTestCase instead. */ -class TestCase extends \PHPUnit\Framework\TestCase +class TestCase extends MonologTestCase { - /** - * @param array $context - * @param array $extra - * - * @phpstan-param value-of|value-of|Level|LogLevel::* $level - */ - protected function getRecord(int|string|Level $level = Level::Warning, string|\Stringable $message = 'test', array $context = [], string $channel = 'test', \DateTimeImmutable $datetime = new JsonSerializableDateTimeImmutable(true), array $extra = []): LogRecord - { - return new LogRecord( - message: (string) $message, - context: $context, - level: Logger::toMonologLevel($level), - channel: $channel, - datetime: $datetime, - extra: $extra, - ); - } - - /** - * @phpstan-return list - */ - protected function getMultipleRecords(): array - { - return [ - $this->getRecord(Level::Debug, 'debug message 1'), - $this->getRecord(Level::Debug, 'debug message 2'), - $this->getRecord(Level::Info, 'information'), - $this->getRecord(Level::Warning, 'warning'), - $this->getRecord(Level::Error, 'error'), - ]; - } - - protected function getIdentityFormatter(): FormatterInterface - { - $formatter = $this->createMock(FormatterInterface::class); - $formatter->expects(self::any()) - ->method('format') - ->willReturnCallback(function ($record) { - return $record->message; - }); - - return $formatter; - } } diff --git a/tests/Monolog/Attribute/AsMonologProcessorTest.php b/tests/Monolog/Attribute/AsMonologProcessorTest.php index 8bee6683..6e3b04c2 100644 --- a/tests/Monolog/Attribute/AsMonologProcessorTest.php +++ b/tests/Monolog/Attribute/AsMonologProcessorTest.php @@ -11,12 +11,10 @@ namespace Monolog\Attribute; -use PHPUnit\Framework\TestCase; - /** * @requires PHP 8.0 */ -final class AsMonologProcessorTest extends TestCase +final class AsMonologProcessorTest extends \Monolog\Test\MonologTestCase { public function test(): void { diff --git a/tests/Monolog/Attribute/WithMonologChannelTest.php b/tests/Monolog/Attribute/WithMonologChannelTest.php index 9396e4b3..776a6e8d 100644 --- a/tests/Monolog/Attribute/WithMonologChannelTest.php +++ b/tests/Monolog/Attribute/WithMonologChannelTest.php @@ -11,9 +11,7 @@ namespace Monolog\Attribute; -use PHPUnit\Framework\TestCase; - -class WithMonologChannelTest extends TestCase +class WithMonologChannelTest extends \Monolog\Test\MonologTestCase { public function test(): void { diff --git a/tests/Monolog/Formatter/ChromePHPFormatterTest.php b/tests/Monolog/Formatter/ChromePHPFormatterTest.php index f290ba69..32894c7f 100644 --- a/tests/Monolog/Formatter/ChromePHPFormatterTest.php +++ b/tests/Monolog/Formatter/ChromePHPFormatterTest.php @@ -12,9 +12,9 @@ namespace Monolog\Formatter; use Monolog\Level; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; -class ChromePHPFormatterTest extends TestCase +class ChromePHPFormatterTest extends MonologTestCase { /** * @covers Monolog\Formatter\ChromePHPFormatter::format diff --git a/tests/Monolog/Formatter/ElasticaFormatterTest.php b/tests/Monolog/Formatter/ElasticaFormatterTest.php index 2698b60a..d28c6014 100644 --- a/tests/Monolog/Formatter/ElasticaFormatterTest.php +++ b/tests/Monolog/Formatter/ElasticaFormatterTest.php @@ -12,9 +12,9 @@ namespace Monolog\Formatter; use Monolog\Level; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; -class ElasticaFormatterTest extends TestCase +class ElasticaFormatterTest extends MonologTestCase { public function setUp(): void { diff --git a/tests/Monolog/Formatter/ElasticsearchFormatterTest.php b/tests/Monolog/Formatter/ElasticsearchFormatterTest.php index 1a53c66e..61c6f1c1 100644 --- a/tests/Monolog/Formatter/ElasticsearchFormatterTest.php +++ b/tests/Monolog/Formatter/ElasticsearchFormatterTest.php @@ -12,9 +12,9 @@ namespace Monolog\Formatter; use Monolog\Level; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; -class ElasticsearchFormatterTest extends TestCase +class ElasticsearchFormatterTest extends MonologTestCase { /** * @covers Monolog\Formatter\ElasticsearchFormatter::__construct diff --git a/tests/Monolog/Formatter/FlowdockFormatterTest.php b/tests/Monolog/Formatter/FlowdockFormatterTest.php index 1b4e8176..5108cafe 100644 --- a/tests/Monolog/Formatter/FlowdockFormatterTest.php +++ b/tests/Monolog/Formatter/FlowdockFormatterTest.php @@ -12,9 +12,9 @@ namespace Monolog\Formatter; use Monolog\Level; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; -class FlowdockFormatterTest extends TestCase +class FlowdockFormatterTest extends MonologTestCase { /** * @covers Monolog\Formatter\FlowdockFormatter::format diff --git a/tests/Monolog/Formatter/FluentdFormatterTest.php b/tests/Monolog/Formatter/FluentdFormatterTest.php index 318a5ca0..9c4ab968 100644 --- a/tests/Monolog/Formatter/FluentdFormatterTest.php +++ b/tests/Monolog/Formatter/FluentdFormatterTest.php @@ -12,9 +12,9 @@ namespace Monolog\Formatter; use Monolog\Level; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; -class FluentdFormatterTest extends TestCase +class FluentdFormatterTest extends MonologTestCase { /** * @covers Monolog\Formatter\FluentdFormatter::__construct diff --git a/tests/Monolog/Formatter/GelfMessageFormatterTest.php b/tests/Monolog/Formatter/GelfMessageFormatterTest.php index cda67e51..bd10d374 100644 --- a/tests/Monolog/Formatter/GelfMessageFormatterTest.php +++ b/tests/Monolog/Formatter/GelfMessageFormatterTest.php @@ -12,9 +12,9 @@ namespace Monolog\Formatter; use Monolog\Level; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; -class GelfMessageFormatterTest extends TestCase +class GelfMessageFormatterTest extends MonologTestCase { public function setUp(): void { diff --git a/tests/Monolog/Formatter/GoogleCloudLoggingFormatterTest.php b/tests/Monolog/Formatter/GoogleCloudLoggingFormatterTest.php index 7888caa7..29c776ec 100644 --- a/tests/Monolog/Formatter/GoogleCloudLoggingFormatterTest.php +++ b/tests/Monolog/Formatter/GoogleCloudLoggingFormatterTest.php @@ -12,10 +12,10 @@ namespace Monolog\Formatter; use DateTimeInterface; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; use function json_decode; -class GoogleCloudLoggingFormatterTest extends TestCase +class GoogleCloudLoggingFormatterTest extends MonologTestCase { /** * @test diff --git a/tests/Monolog/Formatter/JsonFormatterTest.php b/tests/Monolog/Formatter/JsonFormatterTest.php index 3e1cee28..56cef228 100644 --- a/tests/Monolog/Formatter/JsonFormatterTest.php +++ b/tests/Monolog/Formatter/JsonFormatterTest.php @@ -14,9 +14,9 @@ namespace Monolog\Formatter; use Monolog\Level; use Monolog\LogRecord; use JsonSerializable; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; -class JsonFormatterTest extends TestCase +class JsonFormatterTest extends MonologTestCase { /** * @covers Monolog\Formatter\JsonFormatter::__construct diff --git a/tests/Monolog/Formatter/LineFormatterTest.php b/tests/Monolog/Formatter/LineFormatterTest.php index 6f08f76d..37f77dc3 100644 --- a/tests/Monolog/Formatter/LineFormatterTest.php +++ b/tests/Monolog/Formatter/LineFormatterTest.php @@ -11,7 +11,7 @@ namespace Monolog\Formatter; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; use Monolog\Level; use PHPUnit\Framework\Attributes\DataProvider; use RuntimeException; @@ -19,7 +19,7 @@ use RuntimeException; /** * @covers Monolog\Formatter\LineFormatter */ -class LineFormatterTest extends TestCase +class LineFormatterTest extends MonologTestCase { public function testDefFormatWithString() { diff --git a/tests/Monolog/Formatter/LogglyFormatterTest.php b/tests/Monolog/Formatter/LogglyFormatterTest.php index de0aeb85..bf12827f 100644 --- a/tests/Monolog/Formatter/LogglyFormatterTest.php +++ b/tests/Monolog/Formatter/LogglyFormatterTest.php @@ -11,9 +11,9 @@ namespace Monolog\Formatter; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; -class LogglyFormatterTest extends TestCase +class LogglyFormatterTest extends MonologTestCase { /** * @covers Monolog\Formatter\LogglyFormatter::__construct diff --git a/tests/Monolog/Formatter/LogmaticFormatterTest.php b/tests/Monolog/Formatter/LogmaticFormatterTest.php index 00d6536f..26f6a43c 100644 --- a/tests/Monolog/Formatter/LogmaticFormatterTest.php +++ b/tests/Monolog/Formatter/LogmaticFormatterTest.php @@ -11,12 +11,12 @@ namespace Monolog\Formatter; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; /** * @author Julien Breux */ -class LogmaticFormatterTest extends TestCase +class LogmaticFormatterTest extends MonologTestCase { /** * @covers Monolog\Formatter\LogmaticFormatter::format diff --git a/tests/Monolog/Formatter/LogstashFormatterTest.php b/tests/Monolog/Formatter/LogstashFormatterTest.php index ffb0ee3b..58d7b5ad 100644 --- a/tests/Monolog/Formatter/LogstashFormatterTest.php +++ b/tests/Monolog/Formatter/LogstashFormatterTest.php @@ -12,9 +12,9 @@ namespace Monolog\Formatter; use Monolog\Level; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; -class LogstashFormatterTest extends TestCase +class LogstashFormatterTest extends MonologTestCase { /** * @covers Monolog\Formatter\LogstashFormatter::format diff --git a/tests/Monolog/Formatter/MongoDBFormatterTest.php b/tests/Monolog/Formatter/MongoDBFormatterTest.php index ebe46cbd..08f1de19 100644 --- a/tests/Monolog/Formatter/MongoDBFormatterTest.php +++ b/tests/Monolog/Formatter/MongoDBFormatterTest.php @@ -15,13 +15,12 @@ use MongoDB\BSON\ObjectId; use MongoDB\BSON\Regex; use MongoDB\BSON\UTCDateTime; use Monolog\Level; -use Monolog\Test\TestCase; use PHPUnit\Framework\Attributes\DataProvider; /** * @author Florian Plattner */ -class MongoDBFormatterTest extends TestCase +class MongoDBFormatterTest extends \Monolog\Test\MonologTestCase { public function setUp(): void { diff --git a/tests/Monolog/Formatter/NormalizerFormatterTest.php b/tests/Monolog/Formatter/NormalizerFormatterTest.php index b98cfede..0395e1c2 100644 --- a/tests/Monolog/Formatter/NormalizerFormatterTest.php +++ b/tests/Monolog/Formatter/NormalizerFormatterTest.php @@ -11,13 +11,12 @@ namespace Monolog\Formatter; -use Monolog\Test\TestCase; use Monolog\Level; /** * @covers Monolog\Formatter\NormalizerFormatter */ -class NormalizerFormatterTest extends TestCase +class NormalizerFormatterTest extends \Monolog\Test\MonologTestCase { public function testFormat() { diff --git a/tests/Monolog/Formatter/ScalarFormatterTest.php b/tests/Monolog/Formatter/ScalarFormatterTest.php index 693d47da..eae84734 100644 --- a/tests/Monolog/Formatter/ScalarFormatterTest.php +++ b/tests/Monolog/Formatter/ScalarFormatterTest.php @@ -12,9 +12,8 @@ namespace Monolog\Formatter; use Monolog\JsonSerializableDateTimeImmutable; -use Monolog\Test\TestCase; -class ScalarFormatterTest extends TestCase +class ScalarFormatterTest extends \Monolog\Test\MonologTestCase { private ScalarFormatter $formatter; diff --git a/tests/Monolog/Formatter/SyslogFormatterTest.php b/tests/Monolog/Formatter/SyslogFormatterTest.php index cf8d814e..87e528f2 100644 --- a/tests/Monolog/Formatter/SyslogFormatterTest.php +++ b/tests/Monolog/Formatter/SyslogFormatterTest.php @@ -15,9 +15,8 @@ use DateTimeImmutable; use Monolog\Level; use Monolog\LogRecord; use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\TestCase; -class SyslogFormatterTest extends TestCase +class SyslogFormatterTest extends \Monolog\Test\MonologTestCase { /** * @param mixed[] $context diff --git a/tests/Monolog/Formatter/WildfireFormatterTest.php b/tests/Monolog/Formatter/WildfireFormatterTest.php index 06a0fa70..785c537e 100644 --- a/tests/Monolog/Formatter/WildfireFormatterTest.php +++ b/tests/Monolog/Formatter/WildfireFormatterTest.php @@ -12,9 +12,8 @@ namespace Monolog\Formatter; use Monolog\Level; -use Monolog\Test\TestCase; -class WildfireFormatterTest extends TestCase +class WildfireFormatterTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Formatter\WildfireFormatter::format diff --git a/tests/Monolog/Handler/AbstractHandlerTest.php b/tests/Monolog/Handler/AbstractHandlerTest.php index 4520e989..789319e4 100644 --- a/tests/Monolog/Handler/AbstractHandlerTest.php +++ b/tests/Monolog/Handler/AbstractHandlerTest.php @@ -12,9 +12,8 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; -class AbstractHandlerTest extends TestCase +class AbstractHandlerTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Handler\AbstractHandler::__construct diff --git a/tests/Monolog/Handler/AbstractProcessingHandlerTest.php b/tests/Monolog/Handler/AbstractProcessingHandlerTest.php index f44fc431..9d7e2955 100644 --- a/tests/Monolog/Handler/AbstractProcessingHandlerTest.php +++ b/tests/Monolog/Handler/AbstractProcessingHandlerTest.php @@ -11,12 +11,11 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use Monolog\Processor\WebProcessor; use Monolog\Formatter\LineFormatter; -class AbstractProcessingHandlerTest extends TestCase +class AbstractProcessingHandlerTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Handler\FormattableHandlerTrait::getFormatter diff --git a/tests/Monolog/Handler/AmqpHandlerTest.php b/tests/Monolog/Handler/AmqpHandlerTest.php index f60e787e..a9bf6739 100644 --- a/tests/Monolog/Handler/AmqpHandlerTest.php +++ b/tests/Monolog/Handler/AmqpHandlerTest.php @@ -11,14 +11,13 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use PhpAmqpLib\Message\AMQPMessage; /** * @covers Monolog\Handler\RotatingFileHandler */ -class AmqpHandlerTest extends TestCase +class AmqpHandlerTest extends \Monolog\Test\MonologTestCase { public function testHandleAmqpExt() { diff --git a/tests/Monolog/Handler/BrowserConsoleHandlerTest.php b/tests/Monolog/Handler/BrowserConsoleHandlerTest.php index 86d23396..74779e1b 100644 --- a/tests/Monolog/Handler/BrowserConsoleHandlerTest.php +++ b/tests/Monolog/Handler/BrowserConsoleHandlerTest.php @@ -11,13 +11,12 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; /** * @covers Monolog\Handler\BrowserConsoleHandlerTest */ -class BrowserConsoleHandlerTest extends TestCase +class BrowserConsoleHandlerTest extends \Monolog\Test\MonologTestCase { protected function setUp(): void { diff --git a/tests/Monolog/Handler/BufferHandlerTest.php b/tests/Monolog/Handler/BufferHandlerTest.php index 3f1bfb68..ddf1a43c 100644 --- a/tests/Monolog/Handler/BufferHandlerTest.php +++ b/tests/Monolog/Handler/BufferHandlerTest.php @@ -11,10 +11,9 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; -class BufferHandlerTest extends TestCase +class BufferHandlerTest extends \Monolog\Test\MonologTestCase { private TestHandler $shutdownCheckHandler; diff --git a/tests/Monolog/Handler/ChromePHPHandlerTest.php b/tests/Monolog/Handler/ChromePHPHandlerTest.php index b4812d0f..6e530e0a 100644 --- a/tests/Monolog/Handler/ChromePHPHandlerTest.php +++ b/tests/Monolog/Handler/ChromePHPHandlerTest.php @@ -11,14 +11,13 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use PHPUnit\Framework\Attributes\DataProvider; /** * @covers Monolog\Handler\ChromePHPHandler */ -class ChromePHPHandlerTest extends TestCase +class ChromePHPHandlerTest extends \Monolog\Test\MonologTestCase { protected function setUp(): void { diff --git a/tests/Monolog/Handler/CouchDBHandlerTest.php b/tests/Monolog/Handler/CouchDBHandlerTest.php index 289bcf5a..b3a89455 100644 --- a/tests/Monolog/Handler/CouchDBHandlerTest.php +++ b/tests/Monolog/Handler/CouchDBHandlerTest.php @@ -11,10 +11,9 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; -class CouchDBHandlerTest extends TestCase +class CouchDBHandlerTest extends \Monolog\Test\MonologTestCase { public function testHandle() { diff --git a/tests/Monolog/Handler/DeduplicationHandlerTest.php b/tests/Monolog/Handler/DeduplicationHandlerTest.php index f617e019..100bbd53 100644 --- a/tests/Monolog/Handler/DeduplicationHandlerTest.php +++ b/tests/Monolog/Handler/DeduplicationHandlerTest.php @@ -12,9 +12,8 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; -class DeduplicationHandlerTest extends TestCase +class DeduplicationHandlerTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Handler\DeduplicationHandler::flush diff --git a/tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php b/tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php index 1f6f2ffb..ba98e989 100644 --- a/tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php +++ b/tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php @@ -11,10 +11,9 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; -class DoctrineCouchDBHandlerTest extends TestCase +class DoctrineCouchDBHandlerTest extends \Monolog\Test\MonologTestCase { protected function setUp(): void { diff --git a/tests/Monolog/Handler/DynamoDbHandlerTest.php b/tests/Monolog/Handler/DynamoDbHandlerTest.php index d6a0babb..8773cca2 100644 --- a/tests/Monolog/Handler/DynamoDbHandlerTest.php +++ b/tests/Monolog/Handler/DynamoDbHandlerTest.php @@ -12,10 +12,9 @@ namespace Monolog\Handler; use Aws\DynamoDb\DynamoDbClient; -use Monolog\Test\TestCase; use PHPUnit\Framework\MockObject\MockObject; -class DynamoDbHandlerTest extends TestCase +class DynamoDbHandlerTest extends \Monolog\Test\MonologTestCase { private DynamoDbClient&MockObject $client; diff --git a/tests/Monolog/Handler/ElasticaHandlerTest.php b/tests/Monolog/Handler/ElasticaHandlerTest.php index 0582912c..eac80736 100644 --- a/tests/Monolog/Handler/ElasticaHandlerTest.php +++ b/tests/Monolog/Handler/ElasticaHandlerTest.php @@ -13,7 +13,6 @@ namespace Monolog\Handler; use Monolog\Formatter\ElasticaFormatter; use Monolog\Formatter\NormalizerFormatter; -use Monolog\Test\TestCase; use Monolog\Level; use Elastica\Client; use Elastica\Request; @@ -22,7 +21,7 @@ use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; #[Group('Elastica')] -class ElasticaHandlerTest extends TestCase +class ElasticaHandlerTest extends \Monolog\Test\MonologTestCase { /** * @var Client mock diff --git a/tests/Monolog/Handler/ElasticsearchHandlerTest.php b/tests/Monolog/Handler/ElasticsearchHandlerTest.php index f970c31b..4a559bc0 100644 --- a/tests/Monolog/Handler/ElasticsearchHandlerTest.php +++ b/tests/Monolog/Handler/ElasticsearchHandlerTest.php @@ -13,7 +13,6 @@ namespace Monolog\Handler; use Monolog\Formatter\ElasticsearchFormatter; use Monolog\Formatter\NormalizerFormatter; -use Monolog\Test\TestCase; use Monolog\Level; use Elasticsearch\Client; use Elastic\Elasticsearch\Client as Client8; @@ -25,7 +24,7 @@ use PHPUnit\Framework\Attributes\Group; #[Group('Elasticsearch')] #[CoversClass(ElasticsearchHandler::class)] -class ElasticsearchHandlerTest extends TestCase +class ElasticsearchHandlerTest extends \Monolog\Test\MonologTestCase { protected Client|Client8 $client; diff --git a/tests/Monolog/Handler/ErrorLogHandlerTest.php b/tests/Monolog/Handler/ErrorLogHandlerTest.php index f51d22a6..fcc2d53a 100644 --- a/tests/Monolog/Handler/ErrorLogHandlerTest.php +++ b/tests/Monolog/Handler/ErrorLogHandlerTest.php @@ -11,7 +11,6 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use Monolog\Formatter\LineFormatter; @@ -20,7 +19,7 @@ function error_log() $GLOBALS['error_log'][] = \func_get_args(); } -class ErrorLogHandlerTest extends TestCase +class ErrorLogHandlerTest extends \Monolog\Test\MonologTestCase { protected function setUp(): void { diff --git a/tests/Monolog/Handler/FallbackGroupHandlerTest.php b/tests/Monolog/Handler/FallbackGroupHandlerTest.php index c1930679..a33860b0 100644 --- a/tests/Monolog/Handler/FallbackGroupHandlerTest.php +++ b/tests/Monolog/Handler/FallbackGroupHandlerTest.php @@ -13,9 +13,8 @@ namespace Monolog\Handler; use Monolog\Level; use Monolog\LogRecord; -use Monolog\Test\TestCase; -class FallbackGroupHandlerTest extends TestCase +class FallbackGroupHandlerTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Handler\FallbackGroupHandler::__construct diff --git a/tests/Monolog/Handler/FilterHandlerTest.php b/tests/Monolog/Handler/FilterHandlerTest.php index 799ee169..5c77cfe7 100644 --- a/tests/Monolog/Handler/FilterHandlerTest.php +++ b/tests/Monolog/Handler/FilterHandlerTest.php @@ -12,9 +12,8 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; -class FilterHandlerTest extends TestCase +class FilterHandlerTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Handler\FilterHandler::isHandling diff --git a/tests/Monolog/Handler/FingersCrossedHandlerTest.php b/tests/Monolog/Handler/FingersCrossedHandlerTest.php index ba01b9f6..ae3221e1 100644 --- a/tests/Monolog/Handler/FingersCrossedHandlerTest.php +++ b/tests/Monolog/Handler/FingersCrossedHandlerTest.php @@ -12,12 +12,11 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; use Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy; use Psr\Log\LogLevel; -class FingersCrossedHandlerTest extends TestCase +class FingersCrossedHandlerTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Handler\FingersCrossedHandler::__construct diff --git a/tests/Monolog/Handler/FirePHPHandlerTest.php b/tests/Monolog/Handler/FirePHPHandlerTest.php index 40fb6782..59ba4ce3 100644 --- a/tests/Monolog/Handler/FirePHPHandlerTest.php +++ b/tests/Monolog/Handler/FirePHPHandlerTest.php @@ -11,13 +11,12 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; /** * @covers Monolog\Handler\FirePHPHandler */ -class FirePHPHandlerTest extends TestCase +class FirePHPHandlerTest extends \Monolog\Test\MonologTestCase { public function setUp(): void { diff --git a/tests/Monolog/Handler/FleepHookHandlerTest.php b/tests/Monolog/Handler/FleepHookHandlerTest.php index 68cd6bed..96db7356 100644 --- a/tests/Monolog/Handler/FleepHookHandlerTest.php +++ b/tests/Monolog/Handler/FleepHookHandlerTest.php @@ -13,12 +13,11 @@ namespace Monolog\Handler; use Monolog\Formatter\LineFormatter; use Monolog\Level; -use Monolog\Test\TestCase; /** * @coversDefaultClass \Monolog\Handler\FleepHookHandler */ -class FleepHookHandlerTest extends TestCase +class FleepHookHandlerTest extends \Monolog\Test\MonologTestCase { /** * Default token to use in tests diff --git a/tests/Monolog/Handler/FlowdockHandlerTest.php b/tests/Monolog/Handler/FlowdockHandlerTest.php index 90375ced..2fa7927c 100644 --- a/tests/Monolog/Handler/FlowdockHandlerTest.php +++ b/tests/Monolog/Handler/FlowdockHandlerTest.php @@ -12,14 +12,13 @@ namespace Monolog\Handler; use Monolog\Formatter\FlowdockFormatter; -use Monolog\Test\TestCase; use Monolog\Level; /** * @author Dominik Liebler * @see https://www.hipchat.com/docs/api */ -class FlowdockHandlerTest extends TestCase +class FlowdockHandlerTest extends \Monolog\Test\MonologTestCase { /** * @var resource diff --git a/tests/Monolog/Handler/GelfHandlerTest.php b/tests/Monolog/Handler/GelfHandlerTest.php index e96f1166..d0109155 100644 --- a/tests/Monolog/Handler/GelfHandlerTest.php +++ b/tests/Monolog/Handler/GelfHandlerTest.php @@ -12,11 +12,10 @@ namespace Monolog\Handler; use Gelf\Message; -use Monolog\Test\TestCase; use Monolog\Level; use Monolog\Formatter\GelfMessageFormatter; -class GelfHandlerTest extends TestCase +class GelfHandlerTest extends \Monolog\Test\MonologTestCase { public function setUp(): void { diff --git a/tests/Monolog/Handler/GroupHandlerTest.php b/tests/Monolog/Handler/GroupHandlerTest.php index 9247188b..ee712dc6 100644 --- a/tests/Monolog/Handler/GroupHandlerTest.php +++ b/tests/Monolog/Handler/GroupHandlerTest.php @@ -12,10 +12,9 @@ namespace Monolog\Handler; use Monolog\LogRecord; -use Monolog\Test\TestCase; use Monolog\Level; -class GroupHandlerTest extends TestCase +class GroupHandlerTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Handler\GroupHandler::__construct diff --git a/tests/Monolog/Handler/HandlerWrapperTest.php b/tests/Monolog/Handler/HandlerWrapperTest.php index 5836aa88..3dee9da1 100644 --- a/tests/Monolog/Handler/HandlerWrapperTest.php +++ b/tests/Monolog/Handler/HandlerWrapperTest.php @@ -11,14 +11,13 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; /** * @author Alexey Karapetov */ -class HandlerWrapperTest extends TestCase +class HandlerWrapperTest extends \Monolog\Test\MonologTestCase { private HandlerWrapper $wrapper; diff --git a/tests/Monolog/Handler/InsightOpsHandlerTest.php b/tests/Monolog/Handler/InsightOpsHandlerTest.php index 44ec55b3..5e905117 100644 --- a/tests/Monolog/Handler/InsightOpsHandlerTest.php +++ b/tests/Monolog/Handler/InsightOpsHandlerTest.php @@ -11,7 +11,6 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use PHPUnit\Framework\MockObject\MockObject; @@ -19,7 +18,7 @@ use PHPUnit\Framework\MockObject\MockObject; * @author Robert Kaufmann III * @author Gabriel Machado */ -class InsightOpsHandlerTest extends TestCase +class InsightOpsHandlerTest extends \Monolog\Test\MonologTestCase { /** * @var resource diff --git a/tests/Monolog/Handler/LogEntriesHandlerTest.php b/tests/Monolog/Handler/LogEntriesHandlerTest.php index f574e86b..3b24ad56 100644 --- a/tests/Monolog/Handler/LogEntriesHandlerTest.php +++ b/tests/Monolog/Handler/LogEntriesHandlerTest.php @@ -11,14 +11,13 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use PHPUnit\Framework\MockObject\MockObject; /** * @author Robert Kaufmann III */ -class LogEntriesHandlerTest extends TestCase +class LogEntriesHandlerTest extends \Monolog\Test\MonologTestCase { /** * @var resource diff --git a/tests/Monolog/Handler/LogmaticHandlerTest.php b/tests/Monolog/Handler/LogmaticHandlerTest.php index 24ff9029..6da433d0 100644 --- a/tests/Monolog/Handler/LogmaticHandlerTest.php +++ b/tests/Monolog/Handler/LogmaticHandlerTest.php @@ -11,14 +11,13 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use PHPUnit\Framework\MockObject\MockObject; /** * @author Julien Breux */ -class LogmaticHandlerTest extends TestCase +class LogmaticHandlerTest extends \Monolog\Test\MonologTestCase { /** * @var resource diff --git a/tests/Monolog/Handler/MailHandlerTest.php b/tests/Monolog/Handler/MailHandlerTest.php index ebf5c11d..88253e64 100644 --- a/tests/Monolog/Handler/MailHandlerTest.php +++ b/tests/Monolog/Handler/MailHandlerTest.php @@ -12,9 +12,8 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; -class MailHandlerTest extends TestCase +class MailHandlerTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Handler\MailHandler::handleBatch diff --git a/tests/Monolog/Handler/MongoDBHandlerTest.php b/tests/Monolog/Handler/MongoDBHandlerTest.php index d02d32f6..4c348399 100644 --- a/tests/Monolog/Handler/MongoDBHandlerTest.php +++ b/tests/Monolog/Handler/MongoDBHandlerTest.php @@ -12,12 +12,11 @@ namespace Monolog\Handler; use MongoDB\Driver\Manager; -use Monolog\Test\TestCase; /** * @requires extension mongodb */ -class MongoDBHandlerTest extends TestCase +class MongoDBHandlerTest extends \Monolog\Test\MonologTestCase { public function testConstructorShouldThrowExceptionForInvalidMongo() { diff --git a/tests/Monolog/Handler/NativeMailerHandlerTest.php b/tests/Monolog/Handler/NativeMailerHandlerTest.php index 03e288bc..14d5eff4 100644 --- a/tests/Monolog/Handler/NativeMailerHandlerTest.php +++ b/tests/Monolog/Handler/NativeMailerHandlerTest.php @@ -12,32 +12,33 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; function mail($to, $subject, $message, $additional_headers = null, $additional_parameters = null) { $GLOBALS['mail'][] = \func_get_args(); } -class NativeMailerHandlerTest extends TestCase +class NativeMailerHandlerTest extends \Monolog\Test\MonologTestCase { protected function setUp(): void { $GLOBALS['mail'] = []; } - protected function newNativeMailerHandler( ... $args ) : NativeMailerHandler + protected function newNativeMailerHandler(... $args) : NativeMailerHandler { - return new class( ... $args ) extends NativeMailerHandler { - + return new class(... $args) extends NativeMailerHandler { public $mail = []; - protected function mail( string $to, string $subject, string $content, - string $headers, string $parameters ) : void - { + protected function mail( + string $to, + string $subject, + string $content, + string $headers, + string $parameters + ) : void { $this->mail[] = \func_get_args(); } - }; } @@ -121,8 +122,8 @@ class NativeMailerHandlerTest extends TestCase public function testMail() { - $mailer = new NativeMailerHandler('to@example.org', 'subject', 'from@example.org' ); - $mailer->addParameter( 'foo' ); + $mailer = new NativeMailerHandler('to@example.org', 'subject', 'from@example.org'); + $mailer->addParameter('foo'); $mailer->handle($this->getRecord(Level::Error, "FooBarBaz")); $this->assertNotEmpty($GLOBALS['mail']); $this->assertIsArray($GLOBALS['mail']); @@ -132,7 +133,7 @@ class NativeMailerHandlerTest extends TestCase $this->assertSame('to@example.org', $params[0]); $this->assertSame('subject', $params[1]); $this->assertStringContainsString("FooBarBaz", $params[2]); - $this->assertStringContainsString( 'From: from@example.org', $params[3] ); - $this->assertSame( 'foo', $params[4] ); + $this->assertStringContainsString('From: from@example.org', $params[3]); + $this->assertSame('foo', $params[4]); } } diff --git a/tests/Monolog/Handler/NewRelicHandlerTest.php b/tests/Monolog/Handler/NewRelicHandlerTest.php index 17d7e833..c8a1efc7 100644 --- a/tests/Monolog/Handler/NewRelicHandlerTest.php +++ b/tests/Monolog/Handler/NewRelicHandlerTest.php @@ -12,10 +12,9 @@ namespace Monolog\Handler; use Monolog\Formatter\LineFormatter; -use Monolog\Test\TestCase; use Monolog\Level; -class NewRelicHandlerTest extends TestCase +class NewRelicHandlerTest extends \Monolog\Test\MonologTestCase { public static $appname; public static $customParameters; diff --git a/tests/Monolog/Handler/NoopHandlerTest.php b/tests/Monolog/Handler/NoopHandlerTest.php index dd47a871..4065519a 100644 --- a/tests/Monolog/Handler/NoopHandlerTest.php +++ b/tests/Monolog/Handler/NoopHandlerTest.php @@ -12,13 +12,12 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; use PHPUnit\Framework\Attributes\DataProvider; /** * @covers Monolog\Handler\NoopHandler::handle */ -class NoopHandlerTest extends TestCase +class NoopHandlerTest extends \Monolog\Test\MonologTestCase { #[DataProvider('logLevelsProvider')] public function testIsHandling(Level $level) diff --git a/tests/Monolog/Handler/NullHandlerTest.php b/tests/Monolog/Handler/NullHandlerTest.php index 59434b49..99d6f2e5 100644 --- a/tests/Monolog/Handler/NullHandlerTest.php +++ b/tests/Monolog/Handler/NullHandlerTest.php @@ -11,13 +11,12 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; /** * @covers Monolog\Handler\NullHandler::handle */ -class NullHandlerTest extends TestCase +class NullHandlerTest extends \Monolog\Test\MonologTestCase { public function testHandle() { diff --git a/tests/Monolog/Handler/OverflowHandlerTest.php b/tests/Monolog/Handler/OverflowHandlerTest.php index e50966f9..cb62ba4c 100644 --- a/tests/Monolog/Handler/OverflowHandlerTest.php +++ b/tests/Monolog/Handler/OverflowHandlerTest.php @@ -12,13 +12,12 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; /** * @author Kris Buist * @covers \Monolog\Handler\OverflowHandler */ -class OverflowHandlerTest extends TestCase +class OverflowHandlerTest extends \Monolog\Test\MonologTestCase { public function testNotPassingRecordsBeneathLogLevel() { diff --git a/tests/Monolog/Handler/PHPConsoleHandlerTest.php b/tests/Monolog/Handler/PHPConsoleHandlerTest.php index 184d5ac7..e169b65d 100644 --- a/tests/Monolog/Handler/PHPConsoleHandlerTest.php +++ b/tests/Monolog/Handler/PHPConsoleHandlerTest.php @@ -15,7 +15,6 @@ use Exception; use Monolog\ErrorHandler; use Monolog\Level; use Monolog\Logger; -use Monolog\Test\TestCase; use PhpConsole\Connector; use PhpConsole\Dispatcher\Debug as DebugDispatcher; use PhpConsole\Dispatcher\Errors as ErrorDispatcher; @@ -28,7 +27,7 @@ use PHPUnit\Framework\MockObject\MockObject; * @covers Monolog\Handler\PHPConsoleHandler * @author Sergey Barbushin https://www.linkedin.com/in/barbushin */ -class PHPConsoleHandlerTest extends TestCase +class PHPConsoleHandlerTest extends \Monolog\Test\MonologTestCase { protected Connector&MockObject $connector; protected DebugDispatcher&MockObject $debugDispatcher; @@ -201,7 +200,7 @@ class PHPConsoleHandlerTest extends TestCase $handler = $this->initLogger(); $handler->log( \Psr\Log\LogLevel::ERROR, - sprintf('Uncaught Exception %s: "%s" at %s line %s', \get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()), + \sprintf('Uncaught Exception %s: "%s" at %s line %s', \get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()), ['exception' => $e] ); } diff --git a/tests/Monolog/Handler/ProcessHandlerTest.php b/tests/Monolog/Handler/ProcessHandlerTest.php index 2145274b..d781b85c 100644 --- a/tests/Monolog/Handler/ProcessHandlerTest.php +++ b/tests/Monolog/Handler/ProcessHandlerTest.php @@ -11,11 +11,10 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use PHPUnit\Framework\Attributes\DataProvider; -class ProcessHandlerTest extends TestCase +class ProcessHandlerTest extends \Monolog\Test\MonologTestCase { /** * Dummy command to be used by tests that should not fail due to the command. diff --git a/tests/Monolog/Handler/PsrHandlerTest.php b/tests/Monolog/Handler/PsrHandlerTest.php index 2af8ca9b..f5166ee0 100644 --- a/tests/Monolog/Handler/PsrHandlerTest.php +++ b/tests/Monolog/Handler/PsrHandlerTest.php @@ -12,14 +12,13 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; use Monolog\Formatter\LineFormatter; use PHPUnit\Framework\Attributes\DataProvider; /** * @covers Monolog\Handler\PsrHandler::handle */ -class PsrHandlerTest extends TestCase +class PsrHandlerTest extends \Monolog\Test\MonologTestCase { public static function logLevelProvider() { diff --git a/tests/Monolog/Handler/PushoverHandlerTest.php b/tests/Monolog/Handler/PushoverHandlerTest.php index b8d452a0..e2ed1ddd 100644 --- a/tests/Monolog/Handler/PushoverHandlerTest.php +++ b/tests/Monolog/Handler/PushoverHandlerTest.php @@ -11,7 +11,6 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use PHPUnit\Framework\MockObject\MockObject; @@ -21,7 +20,7 @@ use PHPUnit\Framework\MockObject\MockObject; * @author Sebastian Göttschkes * @see https://www.pushover.net/api */ -class PushoverHandlerTest extends TestCase +class PushoverHandlerTest extends \Monolog\Test\MonologTestCase { /** @var resource */ private $res; diff --git a/tests/Monolog/Handler/RedisHandlerTest.php b/tests/Monolog/Handler/RedisHandlerTest.php index ec92fd1d..845e90e9 100644 --- a/tests/Monolog/Handler/RedisHandlerTest.php +++ b/tests/Monolog/Handler/RedisHandlerTest.php @@ -11,11 +11,10 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use Monolog\Formatter\LineFormatter; -class RedisHandlerTest extends TestCase +class RedisHandlerTest extends \Monolog\Test\MonologTestCase { public function testConstructorShouldWorkWithPredis() { diff --git a/tests/Monolog/Handler/RedisPubSubHandlerTest.php b/tests/Monolog/Handler/RedisPubSubHandlerTest.php index 1dea351f..3f2aefc0 100644 --- a/tests/Monolog/Handler/RedisPubSubHandlerTest.php +++ b/tests/Monolog/Handler/RedisPubSubHandlerTest.php @@ -13,11 +13,10 @@ declare(strict_types=1); namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use Monolog\Formatter\LineFormatter; -class RedisPubSubHandlerTest extends TestCase +class RedisPubSubHandlerTest extends \Monolog\Test\MonologTestCase { public function testConstructorShouldWorkWithPredis() { diff --git a/tests/Monolog/Handler/RollbarHandlerTest.php b/tests/Monolog/Handler/RollbarHandlerTest.php index 3496b673..4d245789 100644 --- a/tests/Monolog/Handler/RollbarHandlerTest.php +++ b/tests/Monolog/Handler/RollbarHandlerTest.php @@ -12,7 +12,6 @@ namespace Monolog\Handler; use Exception; -use Monolog\Test\TestCase; use Monolog\Level; use PHPUnit\Framework\MockObject\MockObject; use Rollbar\RollbarLogger; @@ -25,7 +24,7 @@ use Rollbar\RollbarLogger; * * @requires function \Rollbar\RollbarLogger::__construct */ -class RollbarHandlerTest extends TestCase +class RollbarHandlerTest extends \Monolog\Test\MonologTestCase { private RollbarLogger&MockObject $rollbarLogger; diff --git a/tests/Monolog/Handler/RotatingFileHandlerTest.php b/tests/Monolog/Handler/RotatingFileHandlerTest.php index 3ada82ad..ae30f5cb 100644 --- a/tests/Monolog/Handler/RotatingFileHandlerTest.php +++ b/tests/Monolog/Handler/RotatingFileHandlerTest.php @@ -12,13 +12,12 @@ namespace Monolog\Handler; use InvalidArgumentException; -use Monolog\Test\TestCase; use PHPUnit\Framework\Attributes\DataProvider; /** * @covers Monolog\Handler\RotatingFileHandler */ -class RotatingFileHandlerTest extends TestCase +class RotatingFileHandlerTest extends \Monolog\Test\MonologTestCase { private array|null $lastError = null; @@ -84,15 +83,15 @@ class RotatingFileHandlerTest extends TestCase { if (empty($this->lastError)) { $this->fail( - sprintf( + \sprintf( 'Failed asserting that error with code `%d` and message `%s` was triggered', $code, $message ) ); } - $this->assertEquals($code, $this->lastError['code'], sprintf('Expected an error with code %d to be triggered, got `%s` instead', $code, $this->lastError['code'])); - $this->assertEquals($message, $this->lastError['message'], sprintf('Expected an error with message `%d` to be triggered, got `%s` instead', $message, $this->lastError['message'])); + $this->assertEquals($code, $this->lastError['code'], \sprintf('Expected an error with code %d to be triggered, got `%s` instead', $code, $this->lastError['code'])); + $this->assertEquals($message, $this->lastError['message'], \sprintf('Expected an error with message `%d` to be triggered, got `%s` instead', $message, $this->lastError['message'])); } public function testRotationCreatesNewFile() diff --git a/tests/Monolog/Handler/SamplingHandlerTest.php b/tests/Monolog/Handler/SamplingHandlerTest.php index a2d93d9c..f3c4ceb6 100644 --- a/tests/Monolog/Handler/SamplingHandlerTest.php +++ b/tests/Monolog/Handler/SamplingHandlerTest.php @@ -11,12 +11,10 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; - /** * @covers Monolog\Handler\SamplingHandler::handle */ -class SamplingHandlerTest extends TestCase +class SamplingHandlerTest extends \Monolog\Test\MonologTestCase { public function testHandle() { diff --git a/tests/Monolog/Handler/Slack/SlackRecordTest.php b/tests/Monolog/Handler/Slack/SlackRecordTest.php index 0d1eaf3c..463ffa3e 100644 --- a/tests/Monolog/Handler/Slack/SlackRecordTest.php +++ b/tests/Monolog/Handler/Slack/SlackRecordTest.php @@ -12,12 +12,11 @@ namespace Monolog\Handler\Slack; use Monolog\Level; -use Monolog\Test\TestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; #[CoversClass(SlackRecord::class)] -class SlackRecordTest extends TestCase +class SlackRecordTest extends \Monolog\Test\MonologTestCase { public static function dataGetAttachmentColor() { @@ -252,12 +251,12 @@ class SlackRecordTest extends TestCase [ [ 'title' => 'Extra', - 'value' => sprintf('```%s```', json_encode($extra, JSON_PRETTY_PRINT)), + 'value' => \sprintf('```%s```', json_encode($extra, JSON_PRETTY_PRINT)), 'short' => false, ], [ 'title' => 'Context', - 'value' => sprintf('```%s```', json_encode($context, JSON_PRETTY_PRINT)), + 'value' => \sprintf('```%s```', json_encode($context, JSON_PRETTY_PRINT)), 'short' => false, ], ], @@ -306,7 +305,7 @@ class SlackRecordTest extends TestCase ], [ 'title' => 'Tags', - 'value' => sprintf('```%s```', json_encode($extra['tags'])), + 'value' => \sprintf('```%s```', json_encode($extra['tags'])), 'short' => false, ], [ @@ -362,12 +361,12 @@ class SlackRecordTest extends TestCase $expected = [ [ 'title' => 'Info', - 'value' => sprintf('```%s```', json_encode(['author' => 'Jordi'], JSON_PRETTY_PRINT)), + 'value' => \sprintf('```%s```', json_encode(['author' => 'Jordi'], JSON_PRETTY_PRINT)), 'short' => false, ], [ 'title' => 'Tags', - 'value' => sprintf('```%s```', json_encode(['web'])), + 'value' => \sprintf('```%s```', json_encode(['web'])), 'short' => false, ], ]; diff --git a/tests/Monolog/Handler/SlackHandlerTest.php b/tests/Monolog/Handler/SlackHandlerTest.php index f89c00d8..259c18ce 100644 --- a/tests/Monolog/Handler/SlackHandlerTest.php +++ b/tests/Monolog/Handler/SlackHandlerTest.php @@ -11,7 +11,6 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use Monolog\Formatter\LineFormatter; use Monolog\Handler\Slack\SlackRecord; @@ -21,7 +20,7 @@ use PHPUnit\Framework\Attributes\DataProvider; * @author Greg Kedzierski * @see https://api.slack.com/ */ -class SlackHandlerTest extends TestCase +class SlackHandlerTest extends \Monolog\Test\MonologTestCase { /** * @var resource diff --git a/tests/Monolog/Handler/SlackWebhookHandlerTest.php b/tests/Monolog/Handler/SlackWebhookHandlerTest.php index f0c2f2a0..105f34dc 100644 --- a/tests/Monolog/Handler/SlackWebhookHandlerTest.php +++ b/tests/Monolog/Handler/SlackWebhookHandlerTest.php @@ -11,7 +11,6 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use Monolog\Formatter\LineFormatter; use Monolog\Handler\Slack\SlackRecord; @@ -21,7 +20,7 @@ use Monolog\Handler\Slack\SlackRecord; * @see https://api.slack.com/incoming-webhooks * @coversDefaultClass Monolog\Handler\SlackWebhookHandler */ -class SlackWebhookHandlerTest extends TestCase +class SlackWebhookHandlerTest extends \Monolog\Test\MonologTestCase { const WEBHOOK_URL = 'https://hooks.slack.com/services/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E'; diff --git a/tests/Monolog/Handler/SocketHandlerTest.php b/tests/Monolog/Handler/SocketHandlerTest.php index 5a725164..ae0108d4 100644 --- a/tests/Monolog/Handler/SocketHandlerTest.php +++ b/tests/Monolog/Handler/SocketHandlerTest.php @@ -11,14 +11,13 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use PHPUnit\Framework\MockObject\MockObject; /** * @author Pablo de Leon Belloc */ -class SocketHandlerTest extends TestCase +class SocketHandlerTest extends \Monolog\Test\MonologTestCase { private SocketHandler&MockObject $handler; diff --git a/tests/Monolog/Handler/StreamHandlerTest.php b/tests/Monolog/Handler/StreamHandlerTest.php index e030947e..bdce21fd 100644 --- a/tests/Monolog/Handler/StreamHandlerTest.php +++ b/tests/Monolog/Handler/StreamHandlerTest.php @@ -11,11 +11,10 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; use Monolog\Level; use PHPUnit\Framework\Attributes\DataProvider; -class StreamHandlerTest extends TestCase +class StreamHandlerTest extends \Monolog\Test\MonologTestCase { public function tearDown(): void { diff --git a/tests/Monolog/Handler/SymfonyMailerHandlerTest.php b/tests/Monolog/Handler/SymfonyMailerHandlerTest.php index 5e349ffa..a8ed01d6 100644 --- a/tests/Monolog/Handler/SymfonyMailerHandlerTest.php +++ b/tests/Monolog/Handler/SymfonyMailerHandlerTest.php @@ -12,12 +12,11 @@ namespace Monolog\Handler; use Monolog\Logger; -use Monolog\Test\TestCase; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mime\Email; -class SymfonyMailerHandlerTest extends TestCase +class SymfonyMailerHandlerTest extends \Monolog\Test\MonologTestCase { /** @var MailerInterface&MockObject */ private $mailer; diff --git a/tests/Monolog/Handler/SyslogUdpHandlerTest.php b/tests/Monolog/Handler/SyslogUdpHandlerTest.php index 834225d9..7192d90e 100644 --- a/tests/Monolog/Handler/SyslogUdpHandlerTest.php +++ b/tests/Monolog/Handler/SyslogUdpHandlerTest.php @@ -12,12 +12,11 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; /** * @requires extension sockets */ -class SyslogUdpHandlerTest extends TestCase +class SyslogUdpHandlerTest extends \Monolog\Test\MonologTestCase { public function testWeValidateFacilities() { diff --git a/tests/Monolog/Handler/TelegramBotHandlerTest.php b/tests/Monolog/Handler/TelegramBotHandlerTest.php index 88dcdba3..ef0f7969 100644 --- a/tests/Monolog/Handler/TelegramBotHandlerTest.php +++ b/tests/Monolog/Handler/TelegramBotHandlerTest.php @@ -12,14 +12,13 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; use PHPUnit\Framework\MockObject\MockObject; /** * @author Mazur Alexandr * @link https://core.telegram.org/bots/api */ -class TelegramBotHandlerTest extends TestCase +class TelegramBotHandlerTest extends \Monolog\Test\MonologTestCase { private TelegramBotHandler&MockObject $handler; diff --git a/tests/Monolog/Handler/TestHandlerTest.php b/tests/Monolog/Handler/TestHandlerTest.php index d1e1ec32..6df2579c 100644 --- a/tests/Monolog/Handler/TestHandlerTest.php +++ b/tests/Monolog/Handler/TestHandlerTest.php @@ -12,13 +12,12 @@ namespace Monolog\Handler; use Monolog\Level; -use Monolog\Test\TestCase; use PHPUnit\Framework\Attributes\DataProvider; /** * @covers Monolog\Handler\TestHandler */ -class TestHandlerTest extends TestCase +class TestHandlerTest extends \Monolog\Test\MonologTestCase { #[DataProvider('methodProvider')] public function testHandler($method, Level $level) diff --git a/tests/Monolog/Handler/UdpSocketTest.php b/tests/Monolog/Handler/UdpSocketTest.php index 986a3ddb..8250331d 100644 --- a/tests/Monolog/Handler/UdpSocketTest.php +++ b/tests/Monolog/Handler/UdpSocketTest.php @@ -12,12 +12,11 @@ namespace Monolog\Handler; use Monolog\Handler\SyslogUdp\UdpSocket; -use Monolog\Test\TestCase; /** * @requires extension sockets */ -class UdpSocketTest extends TestCase +class UdpSocketTest extends \Monolog\Test\MonologTestCase { public function testWeDoNotTruncateShortMessages() { diff --git a/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php b/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php index 5cb8998d..3473eabe 100644 --- a/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php +++ b/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php @@ -12,10 +12,9 @@ namespace Monolog\Handler; use Monolog\LogRecord; -use Monolog\Test\TestCase; use Monolog\Level; -class WhatFailureGroupHandlerTest extends TestCase +class WhatFailureGroupHandlerTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Handler\WhatFailureGroupHandler::__construct diff --git a/tests/Monolog/Handler/ZendMonitorHandlerTest.php b/tests/Monolog/Handler/ZendMonitorHandlerTest.php index a1064c3b..4f6acb45 100644 --- a/tests/Monolog/Handler/ZendMonitorHandlerTest.php +++ b/tests/Monolog/Handler/ZendMonitorHandlerTest.php @@ -11,9 +11,7 @@ namespace Monolog\Handler; -use Monolog\Test\TestCase; - -class ZendMonitorHandlerTest extends TestCase +class ZendMonitorHandlerTest extends \Monolog\Test\MonologTestCase { public function setUp(): void { diff --git a/tests/Monolog/LoggerTest.php b/tests/Monolog/LoggerTest.php index fab00622..1377c9e0 100644 --- a/tests/Monolog/LoggerTest.php +++ b/tests/Monolog/LoggerTest.php @@ -14,10 +14,10 @@ namespace Monolog; use Monolog\Handler\HandlerInterface; use Monolog\Processor\WebProcessor; use Monolog\Handler\TestHandler; -use Monolog\Test\TestCase; +use Monolog\Test\MonologTestCase; use PHPUnit\Framework\Attributes\DataProvider; -class LoggerTest extends TestCase +class LoggerTest extends MonologTestCase { /** * @covers Logger::getName diff --git a/tests/Monolog/Processor/ClosureContextProcessorTest.php b/tests/Monolog/Processor/ClosureContextProcessorTest.php index 24e35d82..231d8480 100644 --- a/tests/Monolog/Processor/ClosureContextProcessorTest.php +++ b/tests/Monolog/Processor/ClosureContextProcessorTest.php @@ -11,10 +11,9 @@ namespace Monolog\Processor; -use Monolog\Test\TestCase; use PHPUnit\Framework\Attributes\DataProvider; -class ClosureContextProcessorTest extends TestCase +class ClosureContextProcessorTest extends \Monolog\Test\MonologTestCase { public function testReplace() { diff --git a/tests/Monolog/Processor/GitProcessorTest.php b/tests/Monolog/Processor/GitProcessorTest.php index 175dec10..01c43ffc 100644 --- a/tests/Monolog/Processor/GitProcessorTest.php +++ b/tests/Monolog/Processor/GitProcessorTest.php @@ -12,9 +12,8 @@ namespace Monolog\Processor; use Monolog\Level; -use Monolog\Test\TestCase; -class GitProcessorTest extends TestCase +class GitProcessorTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Processor\GitProcessor::__invoke diff --git a/tests/Monolog/Processor/HostnameProcessorTest.php b/tests/Monolog/Processor/HostnameProcessorTest.php index 2329ea85..c70c5502 100644 --- a/tests/Monolog/Processor/HostnameProcessorTest.php +++ b/tests/Monolog/Processor/HostnameProcessorTest.php @@ -11,9 +11,7 @@ namespace Monolog\Processor; -use Monolog\Test\TestCase; - -class HostnameProcessorTest extends TestCase +class HostnameProcessorTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Processor\HostnameProcessor::__invoke diff --git a/tests/Monolog/Processor/IntrospectionProcessorTest.php b/tests/Monolog/Processor/IntrospectionProcessorTest.php index a967ee1f..cfe0f70e 100644 --- a/tests/Monolog/Processor/IntrospectionProcessorTest.php +++ b/tests/Monolog/Processor/IntrospectionProcessorTest.php @@ -27,10 +27,9 @@ function tester($handler, $record) namespace Monolog\Processor; use Monolog\Level; -use Monolog\Test\TestCase; use Monolog\Handler\TestHandler; -class IntrospectionProcessorTest extends TestCase +class IntrospectionProcessorTest extends \Monolog\Test\MonologTestCase { public function getHandler() { diff --git a/tests/Monolog/Processor/LoadAverageProcessorTest.php b/tests/Monolog/Processor/LoadAverageProcessorTest.php index 8882b0f0..e4576682 100644 --- a/tests/Monolog/Processor/LoadAverageProcessorTest.php +++ b/tests/Monolog/Processor/LoadAverageProcessorTest.php @@ -11,9 +11,7 @@ namespace Monolog\Processor; -use Monolog\Test\TestCase; - -class LoadAverageProcessorTest extends TestCase +class LoadAverageProcessorTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Processor\LoadAverageProcessor::__invoke diff --git a/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php b/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php index 0ff304ae..2f04b023 100644 --- a/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php +++ b/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php @@ -11,9 +11,7 @@ namespace Monolog\Processor; -use Monolog\Test\TestCase; - -class MemoryPeakUsageProcessorTest extends TestCase +class MemoryPeakUsageProcessorTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Processor\MemoryPeakUsageProcessor::__invoke diff --git a/tests/Monolog/Processor/MemoryUsageProcessorTest.php b/tests/Monolog/Processor/MemoryUsageProcessorTest.php index a68c71ea..d31fdc56 100644 --- a/tests/Monolog/Processor/MemoryUsageProcessorTest.php +++ b/tests/Monolog/Processor/MemoryUsageProcessorTest.php @@ -11,9 +11,7 @@ namespace Monolog\Processor; -use Monolog\Test\TestCase; - -class MemoryUsageProcessorTest extends TestCase +class MemoryUsageProcessorTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Processor\MemoryUsageProcessor::__invoke diff --git a/tests/Monolog/Processor/MercurialProcessorTest.php b/tests/Monolog/Processor/MercurialProcessorTest.php index 05abef9d..c6977826 100644 --- a/tests/Monolog/Processor/MercurialProcessorTest.php +++ b/tests/Monolog/Processor/MercurialProcessorTest.php @@ -11,9 +11,7 @@ namespace Monolog\Processor; -use Monolog\Test\TestCase; - -class MercurialProcessorTest extends TestCase +class MercurialProcessorTest extends \Monolog\Test\MonologTestCase { private string $oldCwd; private string $testDir; diff --git a/tests/Monolog/Processor/ProcessIdProcessorTest.php b/tests/Monolog/Processor/ProcessIdProcessorTest.php index 57de7220..8b3f22d1 100644 --- a/tests/Monolog/Processor/ProcessIdProcessorTest.php +++ b/tests/Monolog/Processor/ProcessIdProcessorTest.php @@ -11,9 +11,7 @@ namespace Monolog\Processor; -use Monolog\Test\TestCase; - -class ProcessIdProcessorTest extends TestCase +class ProcessIdProcessorTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Processor\ProcessIdProcessor::__invoke diff --git a/tests/Monolog/Processor/PsrLogMessageProcessorTest.php b/tests/Monolog/Processor/PsrLogMessageProcessorTest.php index fd9bfe99..3dc3fdbe 100644 --- a/tests/Monolog/Processor/PsrLogMessageProcessorTest.php +++ b/tests/Monolog/Processor/PsrLogMessageProcessorTest.php @@ -12,10 +12,9 @@ namespace Monolog\Processor; use Monolog\Level; -use Monolog\Test\TestCase; use PHPUnit\Framework\Attributes\DataProvider; -class PsrLogMessageProcessorTest extends TestCase +class PsrLogMessageProcessorTest extends \Monolog\Test\MonologTestCase { #[DataProvider('getPairs')] public function testReplacement($val, $expected) diff --git a/tests/Monolog/Processor/TagProcessorTest.php b/tests/Monolog/Processor/TagProcessorTest.php index db729e54..3e4ca020 100644 --- a/tests/Monolog/Processor/TagProcessorTest.php +++ b/tests/Monolog/Processor/TagProcessorTest.php @@ -11,9 +11,7 @@ namespace Monolog\Processor; -use Monolog\Test\TestCase; - -class TagProcessorTest extends TestCase +class TagProcessorTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Processor\TagProcessor::__invoke diff --git a/tests/Monolog/Processor/UidProcessorTest.php b/tests/Monolog/Processor/UidProcessorTest.php index 14a791f5..b819dce5 100644 --- a/tests/Monolog/Processor/UidProcessorTest.php +++ b/tests/Monolog/Processor/UidProcessorTest.php @@ -11,9 +11,7 @@ namespace Monolog\Processor; -use Monolog\Test\TestCase; - -class UidProcessorTest extends TestCase +class UidProcessorTest extends \Monolog\Test\MonologTestCase { /** * @covers Monolog\Processor\UidProcessor::__invoke diff --git a/tests/Monolog/Processor/WebProcessorTest.php b/tests/Monolog/Processor/WebProcessorTest.php index 7c50127a..e612c9a9 100644 --- a/tests/Monolog/Processor/WebProcessorTest.php +++ b/tests/Monolog/Processor/WebProcessorTest.php @@ -11,9 +11,7 @@ namespace Monolog\Processor; -use Monolog\Test\TestCase; - -class WebProcessorTest extends TestCase +class WebProcessorTest extends \Monolog\Test\MonologTestCase { public function testProcessor() { diff --git a/tests/Monolog/PsrLogCompatTest.php b/tests/Monolog/PsrLogCompatTest.php index ec7de22a..d3cdbfdc 100644 --- a/tests/Monolog/PsrLogCompatTest.php +++ b/tests/Monolog/PsrLogCompatTest.php @@ -17,13 +17,12 @@ use Monolog\Formatter\LineFormatter; use Monolog\Processor\PsrLogMessageProcessor; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; use Psr\Log\InvalidArgumentException; use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; use Stringable; -class PsrLogCompatTest extends TestCase +class PsrLogCompatTest extends \Monolog\Test\MonologTestCase { private TestHandler $handler; diff --git a/tests/Monolog/SignalHandlerTest.php b/tests/Monolog/SignalHandlerTest.php index 586e8431..b7c6cae5 100644 --- a/tests/Monolog/SignalHandlerTest.php +++ b/tests/Monolog/SignalHandlerTest.php @@ -13,15 +13,15 @@ namespace Monolog; use Monolog\Handler\StreamHandler; use Monolog\Handler\TestHandler; +use Monolog\Test\MonologTestCase; use PHPUnit\Framework\Attributes\DataProvider; use Psr\Log\LogLevel; -use Monolog\Test\TestCase; /** * @author Robert Gust-Bardon * @covers Monolog\SignalHandler */ -class SignalHandlerTest extends TestCase +class SignalHandlerTest extends MonologTestCase { private bool $asyncSignalHandling; private array $blockedSignals = [];