You are here

protected function ProcessTestBase::setUp in Media Migration 8

Overrides MigrateProcessTestCase::setUp

2 calls to ProcessTestBase::setUp()
ImgTagToEmbedFilterTest::setUp in tests/src/Unit/Plugin/migrate/process/ImgTagToEmbedFilterTest.php
MediaWysiwygFilterTest::setUp in tests/src/Unit/Plugin/migrate/process/MediaWysiwygFilterTest.php
2 methods override ProcessTestBase::setUp()
ImgTagToEmbedFilterTest::setUp in tests/src/Unit/Plugin/migrate/process/ImgTagToEmbedFilterTest.php
MediaWysiwygFilterTest::setUp in tests/src/Unit/Plugin/migrate/process/MediaWysiwygFilterTest.php

File

tests/src/Unit/Plugin/migrate/process/ProcessTestBase.php, line 71

Class

ProcessTestBase
Base class for testing Media Migration's migrate process plugins.

Namespace

Drupal\Tests\media_migration\Unit\Plugin\migrate\process

Code

protected function setUp() {
  parent::setUp();
  $this->uuidOracle = $this
    ->prophesize(MediaMigrationUuidOracleInterface::class);
  $this->uuidOracle
    ->getMediaUuid(1)
    ->willReturn('jpeg1-uuid');
  $this->uuidOracle
    ->getMediaUuid(2)
    ->willReturn('png2-uuid');
  $this->uuidOracle
    ->getMediaUuid(3)
    ->willReturn('svg3-uuid');
  $this->row
    ->method('getSourceIdValues')
    ->willReturn([
    'nid' => 123,
    'vid' => 456,
    'language' => 'hu',
  ]);
  $this->sourcePlugin = $this
    ->prophesize(DrupalSqlBase::class);
  $this->sourcePlugin
    ->getDatabase()
    ->willReturn($this
    ->getDatabase($this->testDatabase));
  $this->migration = $this
    ->getMigration();
  $this->migration
    ->method('getSourcePlugin')
    ->willReturn($this->sourcePlugin
    ->reveal());
  $this->migration
    ->method('getDestinationConfiguration')
    ->willReturn($this->migrationConfiguration['destination'] ?? []);
  $this->logger = $this
    ->prophesize(LoggerChannelInterface::class);
}