From 44799b356c105481e9b00405189661989633dca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Mon, 15 Feb 2021 22:03:27 +0100 Subject: [PATCH] Remove invalid handlers --- DependencyInjection/MonologExtension.php | 6 ------ .../FixtureMonologExtensionTest.php | 10 ++++++++++ Tests/DependencyInjection/Fixtures/xml/handlers.xml | 12 ++++++++++++ Tests/DependencyInjection/Fixtures/yml/handlers.yml | 4 ++++ 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 Tests/DependencyInjection/Fixtures/xml/handlers.xml create mode 100644 Tests/DependencyInjection/Fixtures/yml/handlers.yml diff --git a/DependencyInjection/MonologExtension.php b/DependencyInjection/MonologExtension.php index 269b36d6..d97cc043 100644 --- a/DependencyInjection/MonologExtension.php +++ b/DependencyInjection/MonologExtension.php @@ -994,13 +994,7 @@ private function getHandlerClassByType($handlerType) $v2HandlerTypesAdded = [ 'elasticsearch' => 'Monolog\Handler\ElasticaHandler', 'fallbackgroup' => 'Monolog\Handler\FallbackGroupHandler', - 'logmatic' => 'Monolog\Handler\LogmaticHandler', 'noop' => 'Monolog\Handler\NoopHandler', - 'overflow' => 'Monolog\Handler\OverflowHandler', - 'process' => 'Monolog\Handler\ProcessHandler', - 'sendgrid' => 'Monolog\Handler\SendGridHandler', - 'sqs' => 'Monolog\Handler\SqsHandler', - 'telegram' => 'Monolog\Handler\TelegramBotHandler', ]; $v2HandlerTypesRemoved = [ diff --git a/Tests/DependencyInjection/FixtureMonologExtensionTest.php b/Tests/DependencyInjection/FixtureMonologExtensionTest.php index 7128a6e4..70ad7b19 100644 --- a/Tests/DependencyInjection/FixtureMonologExtensionTest.php +++ b/Tests/DependencyInjection/FixtureMonologExtensionTest.php @@ -259,6 +259,16 @@ public function testPsr3MessageProcessingDisabledOnNullHandler() $this->assertNotContainsEquals(['pushProcessor', [new Reference('monolog.processor.psr_log_message')]], $methodCalls, 'The PSR-3 processor should not be enabled'); } + public function testHandlersV2() + { + if (\Monolog\Logger::API < 2) { + $this->markTestSkipped('This test requires Monolog v2'); + } + $this->getContainer('handlers'); + + $this->expectNotToPerformAssertions(); + } + public function testPsr3MessageProcessingDisabled() { $container = $this->getContainer('process_psr_3_messages_disabled'); diff --git a/Tests/DependencyInjection/Fixtures/xml/handlers.xml b/Tests/DependencyInjection/Fixtures/xml/handlers.xml new file mode 100644 index 00000000..102c54de --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/xml/handlers.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/Tests/DependencyInjection/Fixtures/yml/handlers.yml b/Tests/DependencyInjection/Fixtures/yml/handlers.yml new file mode 100644 index 00000000..8ab70b78 --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/yml/handlers.yml @@ -0,0 +1,4 @@ +monolog: + handlers: + noop: + type: noop