You are here

public function LoggerServiceTest::testSetChannel in Purge 8.3

@covers ::setChannel

@dataProvider providerTestSetChannel()

File

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

Class

LoggerServiceTest
@coversDefaultClass \Drupal\purge\Logger\LoggerService

Namespace

Drupal\Tests\purge\Unit\Logger

Code

public function testSetChannel($id, $preexists) : void {
  $config_factory = $this
    ->getConfigFactoryStub($this->defaultConfig);
  $service = new LoggerService($config_factory, $this->loggerChannelPartFactory);
  $this
    ->assertEquals($preexists, $service
    ->hasChannel($id));
  $this
    ->assertEquals(NULL, $service
    ->setChannel($id, [
    1,
    2,
    3,
  ]));
  $this
    ->assertEquals(TRUE, $service
    ->hasChannel($id));
}