class MigrationLookupTestCase

Same name and namespace in other branches
  1. 11.x core/modules/migrate/tests/src/Unit/process/MigrationLookupTestCase.php \Drupal\Tests\migrate\Unit\process\MigrationLookupTestCase

Provides container handling for migration lookup unit tests.

Hierarchy

Expanded class hierarchy of MigrationLookupTestCase

File

core/modules/migrate/tests/src/Unit/process/MigrationLookupTestCase.php, line 12

Namespace

Drupal\Tests\migrate\Unit\process
View source
abstract class MigrationLookupTestCase extends MigrateProcessTestCase {
  
  /**
   * The prophecy of the migrate stub service.
   *
   * @var \Prophecy\Prophecy\ObjectProphecy
   */
  protected $migrateStub;
  
  /**
   * The prophecy of the migrate lookup service.
   *
   * @var \Prophecy\Prophecy\ObjectProphecy
   */
  protected $migrateLookup;
  
  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    $this->migrateStub = $this->prophesize(MigrateStub::class);
    $this->migrateLookup = $this->prophesize(MigrateLookupInterface::class);
  }
  
  /**
   * Prepares and sets the container.
   *
   * @return \Symfony\Component\DependencyInjection\ContainerInterface
   *   The prepared container.
   */
  protected function prepareContainer() {
    $container = new ContainerBuilder();
    $container->set('migrate.stub', $this->migrateStub
      ->reveal());
    $container->set('migrate.lookup', $this->migrateLookup
      ->reveal());
    \Drupal::setContainer($container);
    return $container;
  }

}

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