You are here

public function LoggerChannelFactoryTest::test_get_withExistingLoggers in Service Container 7

Same name and namespace in other branches
  1. 7.2 tests/src/Logger/LoggerChannelFactoryTest.php \Drupal\Tests\service_container\Logger\LoggerChannelFactoryTest::test_get_withExistingLoggers()

@covers ::get() @covers ::addLogger()

File

tests/src/Logger/LoggerChannelFactoryTest.php, line 52
Contains \Drupal\Tests\service_container\Logger\LoggerChannelFactoryTest.

Class

LoggerChannelFactoryTest
@coversDefaultClass \Drupal\service_container\Logger\LoggerChannelFactory

Namespace

Drupal\Tests\service_container\Logger

Code

public function test_get_withExistingLoggers() {
  $logger1 = \Mockery::mock('Psr\\Log\\LoggerInterface');
  $logger2 = \Mockery::mock('Psr\\Log\\LoggerInterface');
  $this->loggerChannelFactory
    ->addLogger($logger1);
  $this->loggerChannelFactory
    ->addLogger($logger2);
  $logger_channel = $this->loggerChannelFactory
    ->get('test');
  $this
    ->assertAttributeEquals(array(
    0 => array(
      $logger1,
      $logger2,
    ),
  ), 'loggers', $logger_channel);
}