Skip to content
This repository has been archived by the owner on Jan 3, 2021. It is now read-only.

Commit

Permalink
Add test for logger channel changing feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Taluu committed Jan 5, 2018
1 parent 21c3902 commit f132c1e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/DependencyInjection/WisemblyAmqpExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
use Wisembly\AmqpBundle\GatesBag;
use Wisembly\AmqpBundle\Connection;
use Wisembly\AmqpBundle\UriConnection;

use Wisembly\AmqpBundle\BrokerInterface;
use Wisembly\AmqpBundle\Broker\PeclBroker;

use Wisembly\AmqpBundle\Processor\ConsumerFactory;
use Wisembly\AmqpBundle\Processor\CommandProcessor;

class WisemblyAmqpExtensionTest extends TestCase
{
public function test_it_can_be_instantiated()
Expand Down Expand Up @@ -116,7 +120,23 @@ public function test_it_picks_the_default_connection_if_none_specified()
}
}

private function getContainer(array $config = [])
public function test_it_changes_the_monolog_tag()
{
$container = $this->getContainer([
'logger_channel' => 'foo'
]);

foreach ([CommandProcessor::class, ConsumerFactory::class] as $service) {
$def = $container->getDefinition($service);
$tags = $def->getTag('monolog.logger');

foreach ($tags as $attributes) {
$this->assertSame('foo', $attributes['channel']);
}
}
}

private function getContainer(array $config = []): ContainerBuilder
{
$broker = $this->prophesize(BrokerInterface::class)->reveal();

Expand Down

0 comments on commit f132c1e

Please sign in to comment.