public function MediaWysiwygPluginBaseTest::testProcess in Media Migration 8
Tests MediaWysiwygPluginBase::process.
@covers ::process @dataProvider providerTestProcess
File
- tests/
src/ Unit/ MediaWysiwygPluginBaseTest.php, line 55
Class
- MediaWysiwygPluginBaseTest
- Tests the Bean Media WYSIWYG plugin.
Namespace
Drupal\Tests\media_migration\UnitCode
public function testProcess(array $field_row_values, array $additional_migrations, array $expected_migrations) {
$row = new Row($field_row_values, array_combine(array_keys($field_row_values), array_keys($field_row_values)));
$plugin = $this
->getMockBuilder(MediaWysiwygPluginBase::class)
->setConstructorArgs([
[],
'test_plugin_id',
[
'entity_type_map' => [
'source_entity_type' => 'dest_entity_type',
],
],
])
->setMethods(NULL)
->getMock();
$migrations = static::UNRELATED_MIGRATIONS + $additional_migrations;
$expected_migrations = static::UNRELATED_MIGRATIONS + $expected_migrations;
$actual_processed_migrations = $plugin
->process($migrations, $row);
$this
->assertEquals($expected_migrations, $actual_processed_migrations);
}