protected function MediaKernelTestBase::setUp in Drupal 10
Same name and namespace in other branches
- 8 core/modules/media/tests/src/Kernel/MediaKernelTestBase.php \Drupal\Tests\media\Kernel\MediaKernelTestBase::setUp()
- 9 core/modules/media/tests/src/Kernel/MediaKernelTestBase.php \Drupal\Tests\media\Kernel\MediaKernelTestBase::setUp()
File
- core/
modules/ media/ tests/ src/ Kernel/ MediaKernelTestBase.php, line 59
Class
- MediaKernelTestBase
- Base class for Media kernel tests.
Namespace
Drupal\Tests\media\KernelCode
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('user');
$this
->installEntitySchema('file');
$this
->installSchema('file', 'file_usage');
$this
->installSchema('system', 'sequences');
$this
->installEntitySchema('media');
$this
->installConfig([
'field',
'system',
'image',
'file',
'media',
]);
// Create a test media type.
$this->testMediaType = $this
->createMediaType('test');
// Create a test media type with constraints.
$this->testConstraintsMediaType = $this
->createMediaType('test_constraints');
$this->user = User::create([
'name' => 'username',
'status' => 1,
]);
$this->user
->save();
$this->container
->get('current_user')
->setAccount($this->user);
}