MediaTest.php in Workbench Moderation to Content Moderation 8.2
File
tests/src/Kernel/Migration/MediaTest.php
View source
<?php
namespace Drupal\Tests\wbm2cm\Kernel\Migration;
use Drupal\media_entity\Entity\MediaBundle;
class MediaTest extends TestBase {
protected static $modules = [
'entity',
'field',
'file',
'image',
'media_entity',
];
protected function setUp() {
parent::setUp();
$this
->installConfig('media_entity');
$this
->installEntitySchema('file');
$this
->installEntitySchema('media');
$this
->installEntitySchema('user');
$this
->installSchema('file', 'file_usage');
$this->storage = $this->container
->get('entity_type.manager')
->getStorage('media');
MediaBundle::create([
'id' => 'generic',
'label' => $this
->randomMachineName(),
])
->save();
}
}
Classes
Name |
Description |
MediaTest |
Tests the save-clear-restore migration flow for media items. |