You are here

protected function EntityLookupAccessTest::setUp in Migrate Plus 8.4

Overrides KernelTestBase::setUp

File

tests/src/Kernel/Plugin/migrate/process/EntityLookupAccessTest.php, line 66

Class

EntityLookupAccessTest
Tests Entity Lookup access check.

Namespace

Drupal\Tests\migrate_plus\Kernel\Plugin\migrate\process

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installSchema('system', 'sequences');
  $this
    ->installEntitySchema('profile');
  $this
    ->installEntitySchema('user');
  $this
    ->installConfig([
    'profile',
    'system',
  ]);
  $known_user = $this
    ->createUser([], 'lucuma');

  // Create a profile entity.
  ProfileType::create([
    'id' => 'default',
  ]);
  Profile::create([
    'uid' => $known_user
      ->id(),
    'type' => 'default',
  ])
    ->save();
  $migration_prophecy = $this
    ->prophesize(MigrationInterface::class);
  $migrate_destination_prophecy = $this
    ->prophesize(MigrateDestinationInterface::class);
  $migrate_destination_prophecy
    ->getPluginId()
    ->willReturn('profile');
  $migrate_destination = $migrate_destination_prophecy
    ->reveal();
  $migration_prophecy
    ->getDestinationPlugin()
    ->willReturn($migrate_destination);
  $migration_prophecy
    ->getProcess()
    ->willReturn([]);
  $this->migration = $migration_prophecy
    ->reveal();
  $this->executable = $this
    ->prophesize(MigrateExecutableInterface::class)
    ->reveal();
  $this->row = new Row();
}