You are here

public function LoggerChannelFactoryTest::test_get_noLoggers 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_noLoggers()

@covers ::get()

File

tests/src/Logger/LoggerChannelFactoryTest.php, line 36
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_noLoggers() {
  $logger_channel1 = $this->loggerChannelFactory
    ->get('test');
  $this
    ->assertInstanceOf('Drupal\\service_container\\Logger\\LoggerChannel', $logger_channel1);
  $logger_channel2 = $this->loggerChannelFactory
    ->get('test');
  $this
    ->assertSame($logger_channel1, $logger_channel2);
  $logger_channel3 = $this->loggerChannelFactory
    ->get('test2');
  $this
    ->assertInstanceOf('Drupal\\service_container\\Logger\\LoggerChannel', $logger_channel3);
  $this
    ->assertNotSame($logger_channel1, $logger_channel3);
}