function MigrateTestBase::setTestLogger

Same name in other branches
  1. 8.9.x core/modules/migrate/tests/src/Kernel/MigrateTestBase.php \Drupal\Tests\migrate\Kernel\MigrateTestBase::setTestLogger()
  2. 10 core/modules/migrate/tests/src/Kernel/MigrateTestBase.php \Drupal\Tests\migrate\Kernel\MigrateTestBase::setTestLogger()
  3. 11.x core/modules/migrate/tests/src/Kernel/MigrateTestBase.php \Drupal\Tests\migrate\Kernel\MigrateTestBase::setTestLogger()

Injects the test logger into the container.

2 calls to MigrateTestBase::setTestLogger()
MigrateLookupTest::setUp in core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php
MigrateStubTest::setUp in core/modules/migrate/tests/src/Kernel/MigrateStubTest.php

File

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

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);
}

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