You are here

protected function AcquiadamLoggerFactoryTrait::getLoggerFactoryStub in Media: Acquia DAM 8

Gets a stubbed out Logger factory for Media: Acquia DAM test usage.

Return value

\PHPUnit\Framework\MockObject\MockObject|\Drupal\Core\Logger\LoggerChannelFactoryInterface A mock LoggerChannelFactoryInstance with a media_acquiadam channel.

1 call to AcquiadamLoggerFactoryTrait::getLoggerFactoryStub()
AssetRefreshManagerTest::setUp in tests/src/Unit/AssetRefreshManagerTest.php

File

tests/src/Traits/AcquiadamLoggerFactoryTrait.php, line 19

Class

AcquiadamLoggerFactoryTrait
A shared mock logger channel.

Namespace

Drupal\Tests\media_acquiadam\Traits

Code

protected function getLoggerFactoryStub() {
  $logger_channel = $this
    ->getMockBuilder(LoggerChannelInterface::class)
    ->disableOriginalConstructor()
    ->getMock();
  $logger_factory = $this
    ->getMockBuilder(LoggerChannelFactoryInterface::class)
    ->disableOriginalConstructor()
    ->getMock();
  $logger_factory
    ->method('get')
    ->with('media_acquiadam')
    ->willReturn($logger_channel);
  return $logger_factory;
}