Skip to content

Commit

Permalink
Ad test to cover removed
Browse files Browse the repository at this point in the history
  • Loading branch information
inverse committed Sep 2, 2019
1 parent 88682e2 commit 437b1a9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Tests/DependencyInjection/MonologExtensionTest.php
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection;

use Monolog\Logger;
use Symfony\Bundle\MonologBundle\DependencyInjection\MonologExtension;
use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\LoggerChannelPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down Expand Up @@ -532,6 +533,34 @@ public function testFingersCrossedHandlerWhenExcludedHttpCodesAreSpecified()
$this->assertDICConstructorArguments($handler, [new Reference('monolog.handler.nested'), new Reference('monolog.handler.main.http_code_strategy'), 0, true, true, null]);
}

/**
* @param string $handlerType
* @dataProvider v2RemovedDataProvider
*/
public function testMonologV2RemovedOnV1($handlerType)
{
if (Logger::API === 2) {
$this->doesNotPerformAssertions();

return;
}

$this->expectException(InvalidConfigurationException::class);

$container = new ContainerBuilder();
$loader = new MonologExtension();

$loader->load([['handlers' => ['main' => ['type' => $handlerType]]]], $container);
}

protected function v2RemovedDataProvider()
{
return [
'raven',
'hipchat',
];
}

protected function getContainer(array $config = [], array $thirdPartyDefinitions = [])
{
$container = new ContainerBuilder();
Expand Down

0 comments on commit 437b1a9

Please sign in to comment.