You are here

protected function MigrateTestBase::setTestLogger in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Kernel/MigrateTestBase.php \Drupal\Tests\migrate\Kernel\MigrateTestBase::setTestLogger()
  2. 9 core/modules/migrate/tests/src/Kernel/MigrateTestBase.php \Drupal\Tests\migrate\Kernel\MigrateTestBase::setTestLogger()

Injects the test logger into the container.

File

core/modules/migrate/tests/src/Kernel/MigrateTestBase.php, line 266

Class

MigrateTestBase
Creates abstract base class for migration tests.

Namespace

Drupal\Tests\migrate\Kernel

Code

protected function setTestLogger() {
  $this->logger = $this
    ->prophesize(LoggerChannelInterface::class);
  $this->container
    ->set('logger.channel.migrate', $this->logger
    ->reveal());
  \Drupal::setContainer($this->container);
}