Skip to content

Commit 4120c49

Browse files
committed
ISSUE-278:
- Fixed typo in the `LoggerChannelPass`. - Added separate test-case for the type-hinted aliases for each logger channel.
1 parent c0b0a9b commit 4120c49

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

DependencyInjection/Compiler/LoggerChannelPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ protected function processChannels($configuration)
135135
}
136136

137137
/**
138-
* Create new logger from th monolog.logger_prototype
138+
* Create new logger from the monolog.logger_prototype
139139
*
140140
* @param string $channel
141141
* @param string $loggerId

Tests/DependencyInjection/Compiler/LoggerChannelPassTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ public function testProcess()
5252
}
5353

5454
$this->assertNotNull($container->getDefinition('monolog.logger.additional'));
55+
}
5556

56-
// test below acceptable only for Symfony 4.2+
57+
public function testTypeHintedAliasesExistForEachChannel()
58+
{
5759
if (!\method_exists(ContainerBuilder::class, 'registerAliasForArgument')) {
58-
return;
60+
$this->markTestSkipped('Need DependencyInjection 4.2+ to register type-hinted aliases for channels.');
5961
}
6062

61-
$expectedChannels = \array_keys($expected);
62-
$expectedChannels[] = 'additional';
63+
$container = $this->getContainer();
64+
$expectedChannels = array('test', 'foo', 'bar', 'additional');
6365

6466
foreach ($expectedChannels as $channelName) {
6567
$aliasName = LoggerInterface::class.' $' .$channelName.'Logger';

0 commit comments

Comments
 (0)