Skip to content

Commit 78ad6e2

Browse files
committed
add tests for the custom mapping
1 parent 640aa2d commit 78ad6e2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Tests/Handler/ConsoleHandlerTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ public function testIsHandling()
3838
/**
3939
* @dataProvider provideVerbosityMappingTests
4040
*/
41-
public function testVerbosityMapping($verbosity, $level, $isHandling)
41+
public function testVerbosityMapping($verbosity, $level, $isHandling, array $map = array())
4242
{
4343
$output = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
4444
$output
4545
->expects($this->atLeastOnce())
4646
->method('getVerbosity')
4747
->will($this->returnValue($verbosity))
4848
;
49-
$handler = new ConsoleHandler($output);
49+
$handler = new ConsoleHandler($output, true, $map);
5050
$this->assertSame($isHandling, $handler->isHandling(array('level' => $level)),
5151
'->isHandling returns correct value depending on console verbosity and log level'
5252
);
@@ -64,6 +64,12 @@ public function provideVerbosityMappingTests()
6464
array(OutputInterface::VERBOSITY_VERY_VERBOSE, Logger::DEBUG, false),
6565
array(OutputInterface::VERBOSITY_DEBUG, Logger::DEBUG, true),
6666
array(OutputInterface::VERBOSITY_DEBUG, Logger::EMERGENCY, true),
67+
array(OutputInterface::VERBOSITY_NORMAL, Logger::NOTICE, true, array(
68+
OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE
69+
)),
70+
array(OutputInterface::VERBOSITY_DEBUG, Logger::NOTICE, true, array(
71+
OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE
72+
)),
6773
);
6874
}
6975

0 commit comments

Comments
 (0)