function LoggerChannelFactoryTest::testGet

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php \Drupal\Tests\Core\Logger\LoggerChannelFactoryTest::testGet()
  2. 8.9.x core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php \Drupal\Tests\Core\Logger\LoggerChannelFactoryTest::testGet()
  3. 10 core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php \Drupal\Tests\Core\Logger\LoggerChannelFactoryTest::testGet()

Tests LoggerChannelFactory::get().

@covers ::get

File

core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php, line 23

Class

LoggerChannelFactoryTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Logger%21LoggerChannelFactory.php/class/LoggerChannelFactory/11.x" title="Defines a factory for logging channels." class="local">\Drupal\Core\Logger\LoggerChannelFactory</a> @group Logger

Namespace

Drupal\Tests\Core\Logger

Code

public function testGet() : void {
    $factory = new LoggerChannelFactory($this->createMock(RequestStack::class), $this->createMock(AccountInterface::class));
    // Ensure that when called with the same argument, always the same instance
    // will be returned.
    $this->assertSame($factory->get('test'), $factory->get('test'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.