function MediaMappingUpdateTest::setUp

Overrides UpdatePathTestBase::setUp

File

core/modules/media/tests/src/Functional/Update/MediaMappingUpdateTest.php, line 34

Class

MediaMappingUpdateTest
Tests update functions for the Media module.

Namespace

Drupal\Tests\media\Functional\Update

Code

protected function setUp() : void {
    parent::setUp();
    
    /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */
    $entity_type_manager = $this->container
        ->get('entity_type.manager');
    
    /** @var \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface $update_manager */
    $update_manager = $this->container
        ->get('entity.definition_update_manager');
    $entity_type = $entity_type_manager->getDefinition('media_type');
    $update_manager->installEntityType($entity_type);
    $entity_type = $entity_type_manager->getDefinition('media');
    $update_manager->installEntityType($entity_type);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.