Skip to content

Commit cab593a

Browse files
committed
minor #255 Clean tests about the PSR-3 processor (stof)
This PR was merged into the 3.x-dev branch. Discussion ---------- Clean tests about the PSR-3 processor Tests were not doing the right assertions, and so not covering the feature. This was detected by looking at why PHPUnit was marking the test as risky. Commits ------- e9aa4ae Clean tests about the PSR-3 processor
2 parents b558678 + e9aa4ae commit cab593a

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Tests/DependencyInjection/FixtureMonologExtensionTest.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,17 @@ public function testChannelParametersResolved()
194194
);
195195
}
196196

197+
public function testPsr3MessageProcessingEnabled()
198+
{
199+
$container = $this->getContainer('parameterized_handlers');
200+
201+
$logger = $container->getDefinition('monolog.handler.custom');
202+
203+
$methodCalls = $logger->getMethodCalls();
204+
205+
$this->assertContains(array('pushProcessor', array(new Reference('monolog.processor.psr_log_message'))), $methodCalls, 'The PSR-3 processor should not be enabled', false, false);
206+
}
207+
197208
public function testPsr3MessageProcessingDisabled()
198209
{
199210
$container = $this->getContainer('process_psr_3_messages_disabled');
@@ -202,12 +213,7 @@ public function testPsr3MessageProcessingDisabled()
202213

203214
$methodCalls = $logger->getMethodCalls();
204215

205-
foreach ($methodCalls as $methodCall) {
206-
list($methodName, $params) = $methodCall;
207-
if ($methodName === 'pushProcessor') {
208-
$this->assertNotEquals(array(new Definition('monolog.processor.psr_log_message')), $params);
209-
}
210-
}
216+
$this->assertNotContains(array('pushProcessor', array(new Reference('monolog.processor.psr_log_message'))), $methodCalls, 'The PSR-3 processor should not be enabled', false, false);
211217
}
212218

213219
protected function getContainer($fixture)

0 commit comments

Comments
 (0)