protected function FileEntityItemTest::setUp in Media Migration 8
Overrides MediaMigrationSourceTestBase::setUp
File
- tests/
src/ Kernel/ Plugin/ migrate/ source/ d7/ FileEntityItemTest.php, line 20
Class
- FileEntityItemTest
- Tests the file entiy item source plugin.
Namespace
Drupal\Tests\media_migration\Kernel\Plugin\migrate\source\d7Code
protected function setUp() {
parent::setUp();
$media_dealer = $this
->prophesize(FileEntityDealerManagerInterface::class);
$media_dealer
->createInstanceFromTypeAndScheme(Argument::cetera())
->will(function () {
$source_type = func_get_args()[0][0];
$scheme = func_get_args()[0][1];
return new DummyMediaDealerPlugin([
'scheme' => $scheme,
], $source_type, [
'id' => $source_type,
'destination_media_type_id_base' => $source_type,
'destination_media_source_plugin_id' => $source_type,
]);
});
$this->container
->set('plugin.manager.file_entity_dealer', $media_dealer
->reveal());
\Drupal::setContainer($this->container);
}