You are here

public function LoggerServiceTest::testDestruct in Purge 8.3

@covers ::destruct

@dataProvider providerTestDestruct()

File

tests/src/Unit/Logger/LoggerServiceTest.php, line 61

Class

LoggerServiceTest
@coversDefaultClass \Drupal\purge\Logger\LoggerService

Namespace

Drupal\Tests\purge\Unit\Logger

Code

public function testDestruct($expect_write, $call = NULL, $arguments = []) : void {
  $config_factory = $this
    ->getConfigFactoryStub($this->defaultConfig);
  $config_factory
    ->expects($expect_write ? $this
    ->once() : $this
    ->never())
    ->method('getEditable')
    ->with($this
    ->stringContains('purge.logger_channels'));
  $service = new LoggerService($config_factory, $this->loggerChannelPartFactory);
  if (!is_null($call)) {
    call_user_func_array([
      $service,
      $call,
    ], $arguments);
  }
  $service
    ->destruct();
}